diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-03-18 15:41:11 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 10:24:15 -0400 |
commit | 1821438a9b6a8454281ec2e151014709f641d2d5 (patch) | |
tree | feea275b7e2c94d995e92dcd86a6074ab1832978 /drivers/scsi/scsi_sysfs.c | |
parent | 4f581b97314a2da96fa4d611ebfb586b2828b027 (diff) |
[SCSI] don't reap targets upon device_add failure
This patch (as1358) fixes a bug in the error pathway of
scsi_target_add(). If registration fails, the target should not be
reaped. The reaping occurs later, when scanning is finished and all
the child devices are removed. The current code leaves an unbalanced
value in starget->reap_ref.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 429c9b73e3e4..838a0db8ea1f 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -853,9 +853,6 @@ static int scsi_target_add(struct scsi_target *starget) | |||
853 | error = device_add(&starget->dev); | 853 | error = device_add(&starget->dev); |
854 | if (error) { | 854 | if (error) { |
855 | dev_err(&starget->dev, "target device_add failed, error %d\n", error); | 855 | dev_err(&starget->dev, "target device_add failed, error %d\n", error); |
856 | get_device(&starget->dev); | ||
857 | scsi_target_reap(starget); | ||
858 | put_device(&starget->dev); | ||
859 | return error; | 856 | return error; |
860 | } | 857 | } |
861 | transport_add_device(&starget->dev); | 858 | transport_add_device(&starget->dev); |