diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-02-12 12:13:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-23 15:24:05 -0700 |
commit | 6e3a40450613ba9d77c4f0bad6c27bdbd8891187 (patch) | |
tree | c14156623994d9e77d0190f4bfbae22963a8e7dd /drivers/scsi/scsi_scan.c | |
parent | 3c08ee489ddebd3cd0655940a57e1b71f524ef4a (diff) |
fix refcounting bug in scsi_get_host_dev
commit d5469119f0098881ab7f991990ef4f81ef13a194 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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-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 14d27038159..ed1dfa91745 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -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: |