提交 d5469119 编写于 作者: A Alan Stern 提交者: James Bottomley

[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: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 75f8ee8e
...@@ -1909,10 +1909,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) ...@@ -1909,10 +1909,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
goto out; goto out;
sdev = scsi_alloc_sdev(starget, 0, NULL); sdev = scsi_alloc_sdev(starget, 0, NULL);
if (sdev) { if (sdev)
sdev->sdev_gendev.parent = get_device(&starget->dev);
sdev->borken = 0; sdev->borken = 0;
} else else
scsi_target_reap(starget); scsi_target_reap(starget);
put_device(&starget->dev); put_device(&starget->dev);
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册