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: 8b4673ba3a ("scsi: qla2xxx: Add support for ZIO6 interrupt threshold")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Dan Carpenter 2018-09-20 13:02:36 +03:00 committed by Martin K. Petersen
parent 84e13c453d
commit 1703659dad

View File

@ -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);