aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-20 16:13:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-20 16:13:09 -0400
commit30c278192f9ab06125fb042f6e46763e0fd7140a (patch)
treeeb457072fec9bed01d89a71ab61257785a24a66a
parentef2533dae5a93527f2aac9449c0b1564c5ed2c2f (diff)
parent478971600e47cb83ff2d3c63c5c24f2b04b0d6a1 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] bsg: fix incorrect device_status value [SCSI] Fix VPD inquiry page wrapper
-rw-r--r--block/bsg.c2
-rw-r--r--drivers/scsi/scsi.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 82d58829ba59..0c00870553a3 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -426,7 +426,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
426 /* 426 /*
427 * fill in all the output members 427 * fill in all the output members
428 */ 428 */
429 hdr->device_status = status_byte(rq->errors); 429 hdr->device_status = rq->errors & 0xff;
430 hdr->transport_status = host_byte(rq->errors); 430 hdr->transport_status = host_byte(rq->errors);
431 hdr->driver_status = driver_byte(rq->errors); 431 hdr->driver_status = driver_byte(rq->errors);
432 hdr->info = 0; 432 hdr->info = 0;
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index ad0ed212db4a..348fba0a8976 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -1046,13 +1046,13 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf,
1046 1046
1047 /* If the user actually wanted this page, we can skip the rest */ 1047 /* If the user actually wanted this page, we can skip the rest */
1048 if (page == 0) 1048 if (page == 0)
1049 return -EINVAL; 1049 return 0;
1050 1050
1051 for (i = 0; i < min((int)buf[3], buf_len - 4); i++) 1051 for (i = 0; i < min((int)buf[3], buf_len - 4); i++)
1052 if (buf[i + 4] == page) 1052 if (buf[i + 4] == page)
1053 goto found; 1053 goto found;
1054 1054
1055 if (i < buf[3] && i > buf_len) 1055 if (i < buf[3] && i >= buf_len - 4)
1056 /* ran off the end of the buffer, give us benefit of doubt */ 1056 /* ran off the end of the buffer, give us benefit of doubt */
1057 goto found; 1057 goto found;
1058 /* The device claims it doesn't support the requested page */ 1058 /* The device claims it doesn't support the requested page */