diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2015-12-03 09:32:33 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2015-12-03 09:32:33 -0800 |
commit | be9e2f775f5a3147205c552534c3abf0f9374a13 (patch) | |
tree | 9c10584796d73f80295d9c238a089f12621db316 /drivers/scsi/scsi_sysfs.c | |
parent | e619e6cbecb7fe97a924d625e848605333457b13 (diff) | |
parent | 3ddda3e4c82dea58933bde8d0f6ef34470c360cb (diff) | |
download | linux-be9e2f775f5a3147205c552534c3abf0f9374a13.tar.bz2 |
Merge branch 'mkp-fixes' into fixes
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-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 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; |