mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
[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: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
parent
46ccf6b55b
commit
6bc8d2a0c6
@ -190,6 +190,10 @@ store_dh_state(struct device *dev, struct device_attribute *attr,
|
||||
struct scsi_device_handler *scsi_dh;
|
||||
int err = -EINVAL;
|
||||
|
||||
if (sdev->sdev_state == SDEV_CANCEL ||
|
||||
sdev->sdev_state == SDEV_DEL)
|
||||
return -ENODEV;
|
||||
|
||||
if (!sdev->scsi_dh_data) {
|
||||
/*
|
||||
* Attach to a device handler
|
||||
|
Loading…
Reference in New Issue
Block a user