Commit 1703659d authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: qla2xxx: don't allow negative thresholds

We shouldn't allow negative thresholds.  I don't know what it would do
but it can't be good.

Fixes: 8b4673ba ("scsi: qla2xxx: Add support for ZIO6 interrupt threshold")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 84e13c45
......@@ -1228,7 +1228,7 @@ qla_zio_threshold_store(struct device *dev, struct device_attribute *attr,
return -EINVAL;
if (sscanf(buf, "%d", &val) != 1)
return -EINVAL;
if (val > 256)
if (val < 0 || val > 256)
return -ERANGE;
atomic_set(&vha->hw->zio_threshold, val);
......
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