diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 76ee2e784f75085660524fa35143804659735dbd..4c68d36f9ac2a7165090392370ecf490d8bc0e19 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -993,16 +993,14 @@ static int __remove_child (struct device * dev, void * data) */ void scsi_remove_target(struct device *dev) { - struct device *rdev; - if (scsi_is_target_device(dev)) { __scsi_remove_target(to_scsi_target(dev)); return; } - rdev = get_device(dev); + get_device(dev); device_for_each_child(dev, NULL, __remove_child); - put_device(rdev); + put_device(dev); } EXPORT_SYMBOL(scsi_remove_target);