From: Dan Carpenter Date: Fri, 15 Jul 2022 08:27:03 +0000 (+0300) Subject: net/mlx5: unlock on error path in esw_vfs_changed_event_handler() X-Git-Tag: baikal/aarch64/sdk6.1~3197^2~13^2~3 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=39e77e496a89dfe00a9c2448b5766520714c1ed0;p=kernel.git net/mlx5: unlock on error path in esw_vfs_changed_event_handler() Unlock before returning on this error path. Fixes: 0cad4c36e279 ("net/mlx5: Use devl_ API in mlx5_esw_offloads_devlink_port_register") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 10b0b260f02bf..a9f4c652f859c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -3116,8 +3116,10 @@ esw_vfs_changed_event_handler(struct mlx5_eswitch *esw, const u32 *out) err = mlx5_eswitch_load_vf_vports(esw, new_num_vfs, MLX5_VPORT_UC_ADDR_CHANGE); - if (err) + if (err) { + devl_unlock(devlink); return; + } } esw->esw_funcs.num_vfs = new_num_vfs; devl_unlock(devlink);