1
0
Fork 0

qlogic: check kstrtoul() for errors

[ Upstream commit 5fc853cc01 ]

We accidentally left out the error handling for kstrtoul().

Fixes: a520030e32 ("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>
pull/10/head
Dan Carpenter 2018-07-12 15:23:45 +03:00 committed by Greg Kroah-Hartman
parent 75425326b8
commit bf106eaa18
1 changed files with 2 additions and 0 deletions

View File

@ -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: