[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>
This commit is contained in:
parent
75f8ee8e01
commit
d5469119f0
@ -1909,10 +1909,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
|
||||
goto out;
|
||||
|
||||
sdev = scsi_alloc_sdev(starget, 0, NULL);
|
||||
if (sdev) {
|
||||
sdev->sdev_gendev.parent = get_device(&starget->dev);
|
||||
if (sdev)
|
||||
sdev->borken = 0;
|
||||
} else
|
||||
else
|
||||
scsi_target_reap(starget);
|
||||
put_device(&starget->dev);
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user