diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-12 15:23:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-13 18:28:58 -0700 |
commit | 5fc853cc01c68f84984ecc2d5fd777ecad78240f (patch) | |
tree | 1ccbda219df28b4d5b9f93eb81ce5e22aa62904b | |
parent | c3086637b0d7dbee0925697f8dbee2bcf9637b9f (diff) |
qlogic: check kstrtoul() for errors
We accidentally left out the error handling for kstrtoul().
Fixes: a520030e326a ("qlcnic: Implement flash sysfs callback for 83xx adapter")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index 891f03a7a33d..8d7b9bb910f2 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c @@ -1128,6 +1128,8 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp, struct qlcnic_adapter *adapter = dev_get_drvdata(dev); ret = kstrtoul(buf, 16, &data); + if (ret) + return ret; switch (data) { case QLC_83XX_FLASH_SECTOR_ERASE_CMD: |