From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, netdev@vger.kernel.org
Cc: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com
Subject: [PATCH net v3 3/3] igb: fix nvm.ops.read() error handling
Date: Mon, 12 Jun 2023 13:52:08 -0700 [thread overview]
Message-ID: <20230612205208.115292-4-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20230612205208.115292-1-anthony.l.nguyen@intel.com>
From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Add error handling into igb_set_eeprom() function, in case
nvm.ops.read() fails just quit with error code asap.
Fixes: 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 7d60da1b7bf4..319ed601eaa1 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -822,6 +822,8 @@ static int igb_set_eeprom(struct net_device *netdev,
*/
ret_val = hw->nvm.ops.read(hw, last_word, 1,
&eeprom_buff[last_word - first_word]);
+ if (ret_val)
+ goto out;
}
/* Device's eeprom is always little-endian, word addressable */
@@ -841,6 +843,7 @@ static int igb_set_eeprom(struct net_device *netdev,
hw->nvm.ops.update(hw);
igb_set_fw_version(adapter);
+out:
kfree(eeprom_buff);
return ret_val;
}
--
2.38.1
next prev parent reply other threads:[~2023-06-12 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 20:52 [PATCH net v3 0/3][pull request] Intel Wired LAN Driver Updates 2023-06-12 (igc, igb) Tony Nguyen
2023-06-12 20:52 ` [PATCH net v3 1/3] igc: Clean the TX buffer and TX descriptor ring Tony Nguyen
2023-06-12 20:52 ` [PATCH net v3 2/3] igc: Fix possible system crash when loading module Tony Nguyen
2023-06-12 20:52 ` Tony Nguyen [this message]
2023-06-13 7:54 ` [PATCH net v3 3/3] igb: fix nvm.ops.read() error handling Fijalkowski, Maciej
2023-06-15 5:50 ` [PATCH net v3 0/3][pull request] Intel Wired LAN Driver Updates 2023-06-12 (igc, igb) patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230612205208.115292-4-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.