aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorTony Battersby <tonyb@cybernetics.com>2008-01-22 15:25:49 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 14:40:55 -0500
commit53474c042c0e1be39557474c945ad4a8e653ad46 (patch)
tree52d7719a849d067d2cf837d90d5345600bbe7108 /drivers/scsi/sg.c
parent90c18f3c280f80e0bfbab7c1fc4b282842ccb853 (diff)
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
The patch "[SCSI] sg: use idr to replace static arrays" in 2.6.24-rc1 causes a bogus line to appear in /proc/scsi/sg/devices containing "-1 -1 -1 -1 -1 -1 -1 -1 -1" when there are no SCSI devices in the system. In 2.6.23, /proc/scsi/sg/devices is empty when there are no SCSI devices in the system. A similar problem exists with /proc/scsi/sg/device_strs. The following patch restores the behavior of 2.6.23. Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 78ac48df4de8..17216b76efdc 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2529,7 +2529,7 @@ sg_idr_max_id(int id, void *p, void *data)
2529static int 2529static int
2530sg_last_dev(void) 2530sg_last_dev(void)
2531{ 2531{
2532 int k = 0; 2532 int k = -1;
2533 unsigned long iflags; 2533 unsigned long iflags;
2534 2534
2535 read_lock_irqsave(&sg_index_lock, iflags); 2535 read_lock_irqsave(&sg_index_lock, iflags);