scsi: fix host max depth checking for the 'queue_depth' sysfs interface
[cascardo/linux.git] / drivers / scsi / scsi_sysfs.c
index 1ac38e7..9ad4116 100644 (file)
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
 
        depth = simple_strtoul(buf, NULL, 0);
 
-       if (depth < 1 || depth > sht->can_queue)
+       if (depth < 1 || depth > sdev->host->can_queue)
                return -EINVAL;
 
        retval = sht->change_queue_depth(sdev, depth);