summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAmit Arora2006-05-20 01:14:50 +0200
committerJames Bottomley2006-05-28 19:01:23 +0200
commit091686d3b5569d2ec76b9e6dab7f3608b6f64497 (patch)
tree8e2e85f774899d72b5419fdfb574dd994c35f8fd /drivers
parent[SCSI] zfcp: bump up version number (diff)
downloadkernel-qcow2-linux-091686d3b5569d2ec76b9e6dab7f3608b6f64497.tar.gz
kernel-qcow2-linux-091686d3b5569d2ec76b9e6dab7f3608b6f64497.tar.xz
kernel-qcow2-linux-091686d3b5569d2ec76b9e6dab7f3608b6f64497.zip
[SCSI] Return -EINVAL when "id == max_id" in scsi_scan_host_selected()
The scsi_scan_host_selected() should return -EINVAL when the id is equal to the max_id. Currently it uses ">" when comparing with max_id, and hence leaves the border case when "id==max_id". The channel and lun have values valid from 0 up to, and including, max_channel or max_lun. But, the valid values for id range from 0 to max_id-1. This patch fixes the problem. Signed-off-by: Amit Arora <aarora@in.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index f85d9100f554..fd97d07577ad 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1503,7 +1503,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
__FUNCTION__, channel, id, lun));
if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) ||
- ((id != SCAN_WILD_CARD) && (id > shost->max_id)) ||
+ ((id != SCAN_WILD_CARD) && (id >= shost->max_id)) ||
((lun != SCAN_WILD_CARD) && (lun > shost->max_lun)))
return -EINVAL;