diff options
author | Gal Pressman <gal@nvidia.com> | 2022-06-06 14:57:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 18:11:58 +0200 |
commit | 180473e8e42a1b121ff7f3ffa481698f0a1a1db8 (patch) | |
tree | 9b043a3e4daa90429f252a56698dd6cc7c388840 /drivers/net | |
parent | 7c8df6fad43d9d5d77f281f794b2a93cd02fd1a9 (diff) | |
download | linux-stable-180473e8e42a1b121ff7f3ffa481698f0a1a1db8.tar.gz linux-stable-180473e8e42a1b121ff7f3ffa481698f0a1a1db8.tar.bz2 linux-stable-180473e8e42a1b121ff7f3ffa481698f0a1a1db8.zip |
net/mlx4_en: Fix wrong return value on ioctl EEPROM query failure
[ Upstream commit f5826c8c9d57210a17031af5527056eefdc2b7eb ]
The ioctl EEPROM query wrongly returns success on read failures, fix
that by returning the appropriate error code.
Fixes: 7202da8b7f71 ("ethtool, net/mlx4_en: Cable info, get_module_info/eeprom ethtool support")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20220606115718.14233-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index dd029d91bbc2..b711148a9d50 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -2083,7 +2083,7 @@ static int mlx4_en_get_module_eeprom(struct net_device *dev, en_err(priv, "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n", i, offset, ee->len - i, ret); - return 0; + return ret; } i += ret; |