Skip to content

Commit

Permalink
[SCSI] don't reap targets upon device_add failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
AlanStern authored and James Bottomley committed Apr 11, 2010
1 parent 4f581b9 commit 1821438
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,6 @@ static int scsi_target_add(struct scsi_target *starget)
error = device_add(&starget->dev);
if (error) {
dev_err(&starget->dev, "target device_add failed, error %d\n", error);
get_device(&starget->dev);
scsi_target_reap(starget);
put_device(&starget->dev);
return error;
}
transport_add_device(&starget->dev);
Expand Down

0 comments on commit 1821438

Please sign in to comment.