]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx4_en: Fix wrong return value on ioctl EEPROM query failure
authorGal Pressman <gal@nvidia.com>
Mon, 6 Jun 2022 11:57:18 +0000 (14:57 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jun 2022 03:49:58 +0000 (20:49 -0700)
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>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

index ed5038d98ef6e226d4c5fcc7f4c7958d8160c854..6400a827173cfa898173c9f258859c05de238e42 100644 (file)
@@ -2110,7 +2110,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;