Skip to content

Commit 3f8e82a

Browse files
Shahar Shitritkuba-moo
authored andcommitted
net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys
Since the documentation for mlx5_toggle_port_link states that it should only be used after setting the port register, we add a check for the return value from mlx5_port_set_eth_ptys to ensure the register was successfully set before calling it. Fixes: 667daed ("net/mlx5e: Toggle link only after modifying port parameters") Signed-off-by: Shahar Shitrit <[email protected]> Reviewed-by: Carolina Jubran <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 025f2b8 commit 3f8e82a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,12 @@ static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
14091409
if (!an_changes && link_modes == eproto.admin)
14101410
goto out;
14111411

1412-
mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext);
1412+
err = mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext);
1413+
if (err) {
1414+
netdev_err(priv->netdev, "%s: failed to set ptys reg: %d\n", __func__, err);
1415+
goto out;
1416+
}
1417+
14131418
mlx5_toggle_port_link(mdev);
14141419

14151420
out:

0 commit comments

Comments
 (0)