lkml.org 
[lkml]   [2020]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.6 027/177] net/mlx5: Fix error flow in case of function_setup failure
    Date
    From: Shay Drory <shayd@mellanox.com>

    [ Upstream commit 4f7400d5cbaef676e00cdffb0565bf731c6bb09e ]

    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: e161105e58da ("net/mlx5: Function setup/teardown procedures")
    Signed-off-by: Shay Drory <shayd@mellanox.com>
    Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/mellanox/mlx5/core/main.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
    +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
    @@ -1179,7 +1179,7 @@ int mlx5_load_one(struct mlx5_core_dev *

    err = mlx5_function_setup(dev, boot);
    if (err)
    - goto out;
    + goto err_function;

    if (boot) {
    err = mlx5_init_once(dev);
    @@ -1225,6 +1225,7 @@ err_load:
    mlx5_cleanup_once(dev);
    function_teardown:
    mlx5_function_teardown(dev, boot);
    +err_function:
    dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
    mutex_unlock(&dev->intf_state_mutex);


    \
     
     \ /
      Last update: 2020-06-01 20:12    [W:3.943 / U:1.644 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site