Commit 7f7cc235 authored by Aya Levin's avatar Aya Levin Committed by Saeed Mahameed

net/mlx5e: Fix mlx5e_tx_reporter_create return value

Return error when failing to create a reporter in devlink. Since
NET_DEVLINK mandatory to MLX5_CORE in Kconfig, returned pointer
can't be NULL and can only hold an error in bad path.
Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 8c7698d5
...@@ -296,11 +296,13 @@ int mlx5e_tx_reporter_create(struct mlx5e_priv *priv) ...@@ -296,11 +296,13 @@ int mlx5e_tx_reporter_create(struct mlx5e_priv *priv)
devlink_health_reporter_create(devlink, &mlx5_tx_reporter_ops, devlink_health_reporter_create(devlink, &mlx5_tx_reporter_ops,
MLX5_REPORTER_TX_GRACEFUL_PERIOD, MLX5_REPORTER_TX_GRACEFUL_PERIOD,
true, priv); true, priv);
if (IS_ERR(priv->tx_reporter)) if (IS_ERR(priv->tx_reporter)) {
netdev_warn(priv->netdev, netdev_warn(priv->netdev,
"Failed to create tx reporter, err = %ld\n", "Failed to create tx reporter, err = %ld\n",
PTR_ERR(priv->tx_reporter)); PTR_ERR(priv->tx_reporter));
return IS_ERR_OR_NULL(priv->tx_reporter); return PTR_ERR(priv->tx_reporter);
}
return 0;
} }
void mlx5e_tx_reporter_destroy(struct mlx5e_priv *priv) void mlx5e_tx_reporter_destroy(struct mlx5e_priv *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment