Commit 4162f58b authored by Parav Pandit's avatar Parav Pandit Committed by Saeed Mahameed

net/mlx5: Have single error unwinding path

Having multiple error unwinding path are error prone.
Lets have just one error unwinding path.
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent e7f860e2
...@@ -1217,10 +1217,9 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot) ...@@ -1217,10 +1217,9 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
mlx5_register_device(dev); mlx5_register_device(dev);
set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
out:
mutex_unlock(&dev->intf_state_mutex);
return err; mutex_unlock(&dev->intf_state_mutex);
return 0;
err_devlink_reg: err_devlink_reg:
mlx5_unload(dev); mlx5_unload(dev);
...@@ -1230,8 +1229,8 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot) ...@@ -1230,8 +1229,8 @@ int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
function_teardown: function_teardown:
mlx5_function_teardown(dev, boot); mlx5_function_teardown(dev, boot);
dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
out:
mutex_unlock(&dev->intf_state_mutex); mutex_unlock(&dev->intf_state_mutex);
return err; return err;
} }
......
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