Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_sysfs.c
index dbb206c90ecf3c22e68ea8746ecb845ba78a29b1..64c96c7828ee1056042da4a913d9f3f2b9506506 100644 (file)
@@ -767,8 +767,13 @@ store_state_field(struct device *dev, struct device_attribute *attr,
                        break;
                }
        }
-       if (!state)
+       switch (state) {
+       case SDEV_RUNNING:
+       case SDEV_OFFLINE:
+               break;
+       default:
                return -EINVAL;
+       }
 
        mutex_lock(&sdev->state_mutex);
        ret = scsi_device_set_state(sdev, state);