From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [PATCH net] qlogic: check kstrtoul() for errors Date: Thu, 12 Jul 2018 15:23:45 +0300 Message-ID: <20180712122345.dstjfogysfvfl2iq@kili.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Manish Chopra , Dept-GELinuxNICDev@cavium.com, "David S. Miller" , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org To: Harish Patil , Himanshu Madhani Return-path: Received: from userp2130.oracle.com ([156.151.31.86]:36250 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbeGLMd1 (ORCPT ); Thu, 12 Jul 2018 08:33:27 -0400 Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: We accidentally left out the error handling for kstrtoul(). Fixes: a520030e326a ("qlcnic: Implement flash sysfs callback for 83xx adapter") Signed-off-by: Dan Carpenter 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: