netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] qlogic: check kstrtoul() for errors
@ 2018-07-12 12:23 Dan Carpenter
  2018-07-14  1:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-07-12 12:23 UTC (permalink / raw)
  To: Harish Patil, Himanshu Madhani
  Cc: Manish Chopra, Dept-GELinuxNICDev, David S. Miller, netdev,
	kernel-janitors

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>

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:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] qlogic: check kstrtoul() for errors
  2018-07-12 12:23 [PATCH net] qlogic: check kstrtoul() for errors Dan Carpenter
@ 2018-07-14  1:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-14  1:29 UTC (permalink / raw)
  To: dan.carpenter
  Cc: harish.patil, himanshu.madhani, manish.chopra, Dept-GELinuxNICDev,
	netdev, kernel-janitors

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-14  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-12 12:23 [PATCH net] qlogic: check kstrtoul() for errors Dan Carpenter
2018-07-14  1:29 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).