summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-09-20 13:02:36 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-09-28 02:50:32 +0300
commit1703659dada8a5bfe9c31db6436792cbca1e26ea (patch)
tree6f24aaf98ef4fcfb0810865edbbd19f1afcc7093 /drivers/scsi/qla2xxx
parent84e13c453d8666195fbffb4b596e81daf78e2f11 (diff)
downloadlinux-1703659dada8a5bfe9c31db6436792cbca1e26ea.tar.xz
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: 8b4673ba3a1b ("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>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index a31d23905753..b28f159fdaee 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -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);