diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-09 11:52:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 13:57:30 -0400 |
commit | b7bb125dc3d0ca3f72c9116525ce0f018a9844e1 (patch) | |
tree | 80063303e08e8ae5ef89ef363635e0dc93ead240 /drivers/scsi | |
parent | 49f019d66d056ebb261d261d7c89cb698f5eec18 (diff) |
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')
-rw-r--r-- | drivers/scsi/hosts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 38c3a291efac..bd8e7f323c69 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -435,7 +435,7 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | |||
435 | struct class_device *cdev; | 435 | struct class_device *cdev; |
436 | struct Scsi_Host *shost = ERR_PTR(-ENXIO), *p; | 436 | struct Scsi_Host *shost = ERR_PTR(-ENXIO), *p; |
437 | 437 | ||
438 | down_read(&class->subsys.rwsem); | 438 | down(&class->sem); |
439 | list_for_each_entry(cdev, &class->children, node) { | 439 | list_for_each_entry(cdev, &class->children, node) { |
440 | p = class_to_shost(cdev); | 440 | p = class_to_shost(cdev); |
441 | if (p->host_no == hostnum) { | 441 | if (p->host_no == hostnum) { |
@@ -443,7 +443,7 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | |||
443 | break; | 443 | break; |
444 | } | 444 | } |
445 | } | 445 | } |
446 | up_read(&class->subsys.rwsem); | 446 | up(&class->sem); |
447 | 447 | ||
448 | return shost; | 448 | return shost; |
449 | } | 449 | } |