summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorGal Pressman <gal@nvidia.com>2022-02-02 16:07:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-02 11:38:13 +0100
commit0921d16eb7daadcba871889003fac494f6efc0f5 (patch)
tree0214637f636e4a0c4173def72478608ae39f8ac3 /drivers/net/ethernet
parent4b3a023a13612ece64a3975cb202663a3ccc7022 (diff)
downloadlinux-stable-0921d16eb7daadcba871889003fac494f6efc0f5.tar.gz
linux-stable-0921d16eb7daadcba871889003fac494f6efc0f5.tar.bz2
linux-stable-0921d16eb7daadcba871889003fac494f6efc0f5.zip
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/net/ethernet')
-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 3d824c20d2a4..a5c4e4f0f5b6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1357,7 +1357,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;