diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-02-12 12:13:39 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-18 11:52:39 -0500 |
commit | d5469119f0098881ab7f991990ef4f81ef13a194 (patch) | |
tree | 62ffe8444a7692a222b59dc115c30b9047687e57 /drivers/scsi | |
parent | 75f8ee8e01a6c96652f27da40d4bdac9e2e485f0 (diff) |
[SCSI] fix refcounting bug in scsi_get_host_dev
This patch (as1334) fixes a bug in scsi_get_host_dev(). It
incorrectly calls get_device() on the new device's target.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 60b262d66b5..f697229ae5a 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -1909,10 +1909,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) | |||
1909 | goto out; | 1909 | goto out; |
1910 | 1910 | ||
1911 | sdev = scsi_alloc_sdev(starget, 0, NULL); | 1911 | sdev = scsi_alloc_sdev(starget, 0, NULL); |
1912 | if (sdev) { | 1912 | if (sdev) |
1913 | sdev->sdev_gendev.parent = get_device(&starget->dev); | ||
1914 | sdev->borken = 0; | 1913 | sdev->borken = 0; |
1915 | } else | 1914 | else |
1916 | scsi_target_reap(starget); | 1915 | scsi_target_reap(starget); |
1917 | put_device(&starget->dev); | 1916 | put_device(&starget->dev); |
1918 | out: | 1917 | out: |