diff options
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 8b7fa8aece66..ed9182899f76 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -1100,6 +1100,14 @@ void __scsi_remove_device(struct scsi_device *sdev) | |||
1100 | { | 1100 | { |
1101 | struct device *dev = &sdev->sdev_gendev; | 1101 | struct device *dev = &sdev->sdev_gendev; |
1102 | 1102 | ||
1103 | /* | ||
1104 | * This cleanup path is not reentrant and while it is impossible | ||
1105 | * to get a new reference with scsi_device_get() someone can still | ||
1106 | * hold a previously acquired one. | ||
1107 | */ | ||
1108 | if (sdev->sdev_state == SDEV_DEL) | ||
1109 | return; | ||
1110 | |||
1103 | if (sdev->is_visible) { | 1111 | if (sdev->is_visible) { |
1104 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) | 1112 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) |
1105 | return; | 1113 | return; |