summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-04-09 11:52:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 10:57:30 -0700
commitb7bb125dc3d0ca3f72c9116525ce0f018a9844e1 (patch)
tree80063303e08e8ae5ef89ef363635e0dc93ead240 /drivers/scsi/hosts.c
parent49f019d66d056ebb261d261d7c89cb698f5eec18 (diff)
downloadkernel-crypto-b7bb125dc3d0ca3f72c9116525ce0f018a9844e1.tar.gz
kernel-crypto-b7bb125dc3d0ca3f72c9116525ce0f018a9844e1.tar.xz
kernel-crypto-b7bb125dc3d0ca3f72c9116525ce0f018a9844e1.zip
SCSI: use the proper semaphore to protect the class lists
SCSI was using the incorrect lock to protect walking the list of all devices in the class. This patch fixes this. Cc: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 38c3a291efa..bd8e7f323c6 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -435,7 +435,7 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
struct class_device *cdev;
struct Scsi_Host *shost = ERR_PTR(-ENXIO), *p;
- down_read(&class->subsys.rwsem);
+ down(&class->sem);
list_for_each_entry(cdev, &class->children, node) {
p = class_to_shost(cdev);
if (p->host_no == hostnum) {
@@ -443,7 +443,7 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
break;
}
}
- up_read(&class->subsys.rwsem);
+ up(&class->sem);
return shost;
}