netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'
@ 2017-11-21 19:46 Christophe JAILLET
  2017-11-23 17:31 ` David Miller
  2017-11-28 15:56 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2017-11-21 19:46 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

Error code returned by 'bnxt_read_sfp_module_eeprom_info()' is handled a
few lines above when reading the A0 portion of the EEPROM.
The same should be done when reading the A2 portion of the EEPROM.

In order to correctly propagate an error, update 'rc' in this 2nd call as
well, otherwise 0 (success) is returned.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Un-tested.

If not testing the result of the 2nd call was done on purpose, it should be
documented.
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 7ce1d4b7e67d..b13ce5ebde8d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2136,8 +2136,8 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
 	/* Read A2 portion of the EEPROM */
 	if (length) {
 		start -= ETH_MODULE_SFF_8436_LEN;
-		bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, start,
-						 length, data);
+		rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1,
+						      start, length, data);
 	}
 	return rc;
 }
-- 
2.14.1

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

end of thread, other threads:[~2017-11-28 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 19:46 [PATCH] bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()' Christophe JAILLET
2017-11-23 17:31 ` David Miller
2017-11-28 15:56 ` David Miller
2017-11-28 17:11   ` Michael Chan

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).