Skip to content

Commit

Permalink
net/mlx5e: Fix wrong return value on ioctl EEPROM query failure
Browse files Browse the repository at this point in the history
commit 0b89429 upstream.

The ioctl EEPROM query wrongly returns success on read failures, fix
that by returning the appropriate error code.

Fixes: bb64143 ("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>
  • Loading branch information
gal-pressman authored and gregkh committed Mar 2, 2022
1 parent fd020ea commit bc8f768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
Expand Up @@ -1746,7 +1746,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;
Expand Down

0 comments on commit bc8f768

Please sign in to comment.