From: Christophe JAILLET Date: Tue, 21 Nov 2017 19:46:49 +0000 (+0100) Subject: bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()' X-Git-Tag: v4.1.12-124.31.3~934 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b79ff6240f2cf3cc472fc410e10569275bddd393;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()' Orabug: 27648355, 27648339 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 Signed-off-by: David S. Miller (cherry picked from commit dea521a2b9f96e905fa2bb2f95e23ec00c2ec436) Signed-off-by: Brian Maly Reviewed-by: Jack Vogel --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 10c07d785295..08dad14ac101 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -2354,8 +2354,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; }