Skip to content

Commit

Permalink
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tony Battersby authored and James Bottomley committed Jan 23, 2008
1 parent 90c18f3 commit 53474c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,7 @@ sg_idr_max_id(int id, void *p, void *data)
static int
sg_last_dev(void)
{
int k = 0;
int k = -1;
unsigned long iflags;

read_lock_irqsave(&sg_index_lock, iflags);
Expand Down

0 comments on commit 53474c0

Please sign in to comment.