From 108ff4c263028e56b347a5451581180b3868003b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 18 Nov 2003 02:09:47 -0800 Subject: [PATCH] [PATCH] Fix scsi_report_lun_scan sign bug We need to make the scan data unsigned, since we do length = ((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3] << 0)); and if data[3] is 0xff, this expression will always evaluate to 0xffffffff. etcetera. --- drivers/scsi/scsi_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 23af5ced26cf5..e6be91bb719eb 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -899,7 +899,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. @@ -990,7 +990,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)); -- 2.53.0