Commit 6bc8d2a0 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley

[SCSI] scsi_dh: Check for sdev state in store_dh_state()

Avoid attaching a hardware handler to a device which is
already scheduled for deletion.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 46ccf6b5
...@@ -190,6 +190,10 @@ store_dh_state(struct device *dev, struct device_attribute *attr, ...@@ -190,6 +190,10 @@ store_dh_state(struct device *dev, struct device_attribute *attr,
struct scsi_device_handler *scsi_dh; struct scsi_device_handler *scsi_dh;
int err = -EINVAL; int err = -EINVAL;
if (sdev->sdev_state == SDEV_CANCEL ||
sdev->sdev_state == SDEV_DEL)
return -ENODEV;
if (!sdev->scsi_dh_data) { if (!sdev->scsi_dh_data) {
/* /*
* Attach to a device handler * Attach to a device handler
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment