Skip to content

Commit 4f7400d

Browse files
shayshdSaeed Mahameed
authored andcommitted
net/mlx5: Fix error flow in case of function_setup failure
Currently, if an error occurred during mlx5_function_setup(), we keep dev->state as DEVICE_STATE_UP. Fixing it by adding a goto label. Fixes: e161105 ("net/mlx5: Function setup/teardown procedures") Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent d37bd5e commit 4f7400d

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
11951195

11961196
err = mlx5_function_setup(dev, boot);
11971197
if (err)
1198-
goto out;
1198+
goto err_function;
11991199

12001200
if (boot) {
12011201
err = mlx5_init_once(dev);
@@ -1233,6 +1233,7 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
12331233
mlx5_cleanup_once(dev);
12341234
function_teardown:
12351235
mlx5_function_teardown(dev, boot);
1236+
err_function:
12361237
dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
12371238
mutex_unlock(&dev->intf_state_mutex);
12381239

0 commit comments

Comments
 (0)