diff options
author | Mike Anderson <andmike@us.ibm.com> | 2006-03-14 11:18:46 -0800 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-14 14:36:00 -0600 |
commit | a50a5e3792a6c65f95dab547dba45608bd193404 (patch) | |
tree | d402d0d9e53bb8c37a4a96f5b1d168a27cfaaaee /drivers/scsi/scsi_scan.c | |
parent | 9dec70e053613c31e8feab9e14607eaaed99d77c (diff) |
[SCSI] scsi: move target_destroy call
This patch moves the calling of target_destroy next to the list_del. This
closed a race being seen while doing a device add on the aic7xxx.
Signed-off-by: Mike Anderson <andmike@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
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 9cd4404cf9ab..f14945996ede 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -288,10 +288,7 @@ static void scsi_target_dev_release(struct device *dev) { struct device *parent = dev->parent; struct scsi_target *starget = to_scsi_target(dev); - struct Scsi_Host *shost = dev_to_shost(parent); - if (shost->hostt->target_destroy) - shost->hostt->target_destroy(starget); kfree(starget); put_device(parent); } @@ -416,6 +413,8 @@ static void scsi_target_reap_usercontext(void *data) device_del(&starget->dev); transport_destroy_device(&starget->dev); spin_lock_irqsave(shost->host_lock, flags); + if (shost->hostt->target_destroy) + shost->hostt->target_destroy(starget); list_del_init(&starget->siblings); spin_unlock_irqrestore(shost->host_lock, flags); put_device(&starget->dev); |