Skip to content

Commit 30c2781

Browse files
committed
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
2 parents ef2533d + 4789716 commit 30c2781

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

block/bsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
426426
/*
427427
* fill in all the output members
428428
*/
429-
hdr->device_status = status_byte(rq->errors);
429+
hdr->device_status = rq->errors & 0xff;
430430
hdr->transport_status = host_byte(rq->errors);
431431
hdr->driver_status = driver_byte(rq->errors);
432432
hdr->info = 0;

drivers/scsi/scsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,13 @@ int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf,
10461046

10471047
/* If the user actually wanted this page, we can skip the rest */
10481048
if (page == 0)
1049-
return -EINVAL;
1049+
return 0;
10501050

10511051
for (i = 0; i < min((int)buf[3], buf_len - 4); i++)
10521052
if (buf[i + 4] == page)
10531053
goto found;
10541054

1055-
if (i < buf[3] && i > buf_len)
1055+
if (i < buf[3] && i >= buf_len - 4)
10561056
/* ran off the end of the buffer, give us benefit of doubt */
10571057
goto found;
10581058
/* The device claims it doesn't support the requested page */

0 commit comments

Comments
 (0)