summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-07-12 15:23:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-24 13:26:59 +0200
commit7795ce1182d5317688750126958954e5d32e3eac (patch)
treeaa01a190b2b78117b539fb787a41f37f9b9eb1b4 /drivers/net/ethernet
parent01a8ef2f327a6fe5075ee5027c9fa02df42c1c4e (diff)
downloadlinux-stable-7795ce1182d5317688750126958954e5d32e3eac.tar.gz
linux-stable-7795ce1182d5317688750126958954e5d32e3eac.tar.bz2
linux-stable-7795ce1182d5317688750126958954e5d32e3eac.zip
qlogic: check kstrtoul() for errors
[ Upstream commit 5fc853cc01c68f84984ecc2d5fd777ecad78240f ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c2
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 ccbb04503b27..b53a18e365c2 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: