summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGal Pressman <gal@nvidia.com>2022-02-02 17:07:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-02 13:47:57 +0300
commit163e50b00530d3a64a0dda7be80c0bf25987626b (patch)
treeda33b400ce229eb7b756ebcb07383ccb63234c4c /drivers
parent143dafa60aa7f0894a8f1b63b001e3a6f30169a0 (diff)
downloadlinux-163e50b00530d3a64a0dda7be80c0bf25987626b.tar.xz
net/mlx5e: Fix wrong return value on ioctl EEPROM query failure
commit 0b89429722353d112f8b8b29ca397e95fa994d27 upstream. The ioctl EEPROM query wrongly returns success on read failures, fix that by returning the appropriate error code. Fixes: bb64143eee8c ("net/mlx5e: Add ethtool support for dump module EEPROM") Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index dc9b8718c3c1..2d3cd237355a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1754,7 +1754,7 @@ static int mlx5e_get_module_eeprom(struct net_device *netdev,
if (size_read < 0) {
netdev_err(priv->netdev, "%s: mlx5_query_eeprom failed:0x%x\n",
__func__, size_read);
- return 0;
+ return size_read;
}
i += size_read;