Skip to content

Commit

Permalink
qlogic: check kstrtoul() for errors
Browse files Browse the repository at this point in the history
We accidentally left out the error handling for kstrtoul().

Fixes: a520030 ("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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jul 14, 2018
1 parent c308663 commit 5fc853c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5fc853c

Please sign in to comment.