diff mbox series

[net] qlogic: check kstrtoul() for errors

Message ID 20180712122345.dstjfogysfvfl2iq@kili.mountain
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] qlogic: check kstrtoul() for errors | expand

Commit Message

Dan Carpenter July 12, 2018, 12:23 p.m. UTC
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>

Comments

David Miller July 14, 2018, 1:29 a.m. UTC | #1
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 mbox series

Patch

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: