projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[cascardo/linux.git]
/
drivers
/
scsi
/
hosts.c
diff --git
a/drivers/scsi/hosts.c
b/drivers/scsi/hosts.c
index
3690360
..
35cd892
100644
(file)
--- a/
drivers/scsi/hosts.c
+++ b/
drivers/scsi/hosts.c
@@
-290,7
+290,7
@@
static void scsi_host_dev_release(struct device *dev)
kfree(shost);
}
kfree(shost);
}
-struct device_type scsi_host_type = {
+st
atic st
ruct device_type scsi_host_type = {
.name = "scsi_host",
.release = scsi_host_dev_release,
};
.name = "scsi_host",
.release = scsi_host_dev_release,
};
@@
-456,6
+456,10
@@
static int __scsi_host_match(struct device *dev, void *data)
*
* Return value:
* A pointer to located Scsi_Host or NULL.
*
* 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)
{
**/
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);
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));
shost = scsi_host_get(class_to_shost(cdev));
-
+ put_device(cdev);
+ }
return shost;
}
EXPORT_SYMBOL(scsi_host_lookup);
return shost;
}
EXPORT_SYMBOL(scsi_host_lookup);