]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix scsi_report_lun_scan bug
authorAndrew Morton <akpm@osdl.org>
Wed, 19 Nov 2003 05:04:07 +0000 (23:04 -0600)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 19 Nov 2003 05:04:07 +0000 (23:04 -0600)
Original report and bug fix from: Amit Patel <patelamitv@yahoo.com>

The problem was a signed vs unsigned char problem when computing luns
for scanning.

drivers/scsi/scsi_scan.c

index 9e9f9c68d2b96237c0cd7167f058fda33daa5010..0ba726010504255cdeb90e9ac949c5a5dc54914b 100644 (file)
@@ -900,7 +900,7 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags,
        unsigned int retries;
        struct scsi_lun *lunp, *lun_data;
        struct scsi_request *sreq;
-       char *data;
+       u8 *data;
 
        /*
         * Only support SCSI-3 and up devices.
@@ -991,7 +991,7 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags,
        /*
         * Get the length from the first four bytes of lun_data.
         */
-       data = (char *) lun_data->scsi_lun;
+       data = (u8 *) lun_data->scsi_lun;
        length = ((data[0] << 24) | (data[1] << 16) |
                  (data[2] << 8) | (data[3] << 0));