summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 09:32:33 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 09:32:33 -0800
commitbe9e2f775f5a3147205c552534c3abf0f9374a13 (patch)
tree9c10584796d73f80295d9c238a089f12621db316 /drivers/scsi/scsi_sysfs.c
parente619e6cbecb7fe97a924d625e848605333457b13 (diff)
parent3ddda3e4c82dea58933bde8d0f6ef34470c360cb (diff)
Merge branch 'mkp-fixes' into fixes
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index f5ace2bfc6db..21930c9ac9cd 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1102,6 +1102,14 @@ void __scsi_remove_device(struct scsi_device *sdev)
{
struct device *dev = &sdev->sdev_gendev;
+ /*
+ * This cleanup path is not reentrant and while it is impossible
+ * to get a new reference with scsi_device_get() someone can still
+ * hold a previously acquired one.
+ */
+ if (sdev->sdev_state == SDEV_DEL)
+ return;
+
if (sdev->is_visible) {
if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
return;