Message ID | 20180712122345.dstjfogysfvfl2iq@kili.mountain |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Series | [net] qlogic: check kstrtoul() for errors | expand |
From: Dan Carpenter <dan.carpenter@oracle.com> Date: Thu, 12 Jul 2018 15:23:45 +0300 > 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> Applied.
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:
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>