diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-02-20 08:39:13 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-06 19:26:46 -0500 |
commit | b8870ec63676aba1d823f0b36c5f7e9929e57d23 (patch) | |
tree | 0a2a2e27a4bc2a354822048f55c6cdf16cd398aa /drivers/scsi | |
parent | f996861be108f6152d60d7357301697c3309c77f (diff) | |
download | linux-b8870ec63676aba1d823f0b36c5f7e9929e57d23.tar.gz linux-b8870ec63676aba1d823f0b36c5f7e9929e57d23.tar.bz2 linux-b8870ec63676aba1d823f0b36c5f7e9929e57d23.zip |
scsi: qla2xxx: check for kstrtol() failure
The error handling was unintentionally left out so it introduces a Smatch
static checker warning:
drivers/scsi/qla2xxx/qla_attr.c:1655 qla2x00_port_speed_store()
error: uninitialized symbol 'type'.
Fixes: a7b9ca7fc87a ("scsi: qla2xxx: Add support for setting port speed")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index f8fd482a06e0..41734efe4bf9 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1652,6 +1652,8 @@ qla2x00_port_speed_store(struct device *dev, struct device_attribute *attr, } rval = kstrtol(buf, 10, &type); + if (rval) + return rval; speed = type; if (type == 40 || type == 80 || type == 160 || type == 320) { |