Commit 6e3a4045 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

fix refcounting bug in scsi_get_host_dev

commit d5469119 upstream.

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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3c08ee48
......@@ -1906,10 +1906,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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment