aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c5
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)
288{ 288{
289 struct device *parent = dev->parent; 289 struct device *parent = dev->parent;
290 struct scsi_target *starget = to_scsi_target(dev); 290 struct scsi_target *starget = to_scsi_target(dev);
291 struct Scsi_Host *shost = dev_to_shost(parent);
292 291
293 if (shost->hostt->target_destroy)
294 shost->hostt->target_destroy(starget);
295 kfree(starget); 292 kfree(starget);
296 put_device(parent); 293 put_device(parent);
297} 294}
@@ -416,6 +413,8 @@ static void scsi_target_reap_usercontext(void *data)
416 device_del(&starget->dev); 413 device_del(&starget->dev);
417 transport_destroy_device(&starget->dev); 414 transport_destroy_device(&starget->dev);
418 spin_lock_irqsave(shost->host_lock, flags); 415 spin_lock_irqsave(shost->host_lock, flags);
416 if (shost->hostt->target_destroy)
417 shost->hostt->target_destroy(starget);
419 list_del_init(&starget->siblings); 418 list_del_init(&starget->siblings);
420 spin_unlock_irqrestore(shost->host_lock, flags); 419 spin_unlock_irqrestore(shost->host_lock, flags);
421 put_device(&starget->dev); 420 put_device(&starget->dev);