Skip to content

Commit

Permalink
[SCSI] scsi: move target_destroy call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Anderson authored and James Bottomley committed Mar 14, 2006
1 parent 9dec70e commit a50a5e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/scsi/scsi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a50a5e3

Please sign in to comment.