diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-23 11:29:11 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-23 11:29:11 +0200 |
commit | 1e74f9cbbba5348a6c58988cce0f19d6ef887cc8 (patch) | |
tree | 47fcfdba6a17a02cf6745146ebb2ae435405ab1a /drivers/scsi/hosts.c | |
parent | 31a72bce0bd6f3e0114009288bccbc96376eeeca (diff) | |
parent | 481c5346d0981940ee63037eb53e4e37b0735c10 (diff) |
Merge branch 'linus' into core/rcutip-core-rcu-2008-06-23_09.29_Mon
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3690360d7a79..c6457bfc8a49 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -456,6 +456,10 @@ static int __scsi_host_match(struct device *dev, void *data) * * Return value: * A pointer to located Scsi_Host or NULL. + * + * The caller must do a scsi_host_put() to drop the reference + * that scsi_host_get() took. The put_device() below dropped + * the reference from class_find_device(). **/ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) { @@ -463,9 +467,10 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) struct Scsi_Host *shost = ERR_PTR(-ENXIO); cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); - if (cdev) + if (cdev) { shost = scsi_host_get(class_to_shost(cdev)); - + put_device(cdev); + } return shost; } EXPORT_SYMBOL(scsi_host_lookup); |