]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bsg: fix incorrect device_status value
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Thu, 16 Sep 2010 15:46:42 +0000 (00:46 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:43:23 +0000 (12:43 -0700)
commit 478971600e47cb83ff2d3c63c5c24f2b04b0d6a1 upstream.

bsg incorrectly returns sg's masked_status value for device_status.

[jejb: fix up expression logic]
Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
block/bsg.c

index a9fd2d84b53a0cf86ed3aedfd947f600aa88037e..ae14805451a7bf08df29a4154530447c3a6d09ea 100644 (file)
@@ -425,7 +425,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
        /*
         * fill in all the output members
         */
-       hdr->device_status = status_byte(rq->errors);
+       hdr->device_status = rq->errors & 0xff;
        hdr->transport_status = host_byte(rq->errors);
        hdr->driver_status = driver_byte(rq->errors);
        hdr->info = 0;