lkml.org 
[lkml]   [2018]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.14 068/100] bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'
    Date
    From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

    [ Upstream commit dea521a2b9f96e905fa2bb2f95e23ec00c2ec436 ]

    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    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 3cbe771b3352..a22336fef66b 100644
    --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
    +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
    @@ -2133,8 +2133,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.11.0
    \
     
     \ /
      Last update: 2018-01-24 05:16    [W:4.038 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site