]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: unlock on error path in esw_vfs_changed_event_handler()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Jul 2022 08:27:03 +0000 (11:27 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 22 Aug 2022 19:57:09 +0000 (12:57 -0700)
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 <dan.carpenter@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index 10b0b260f02bf41822d4e6436443b0d992d14525..a9f4c652f859c770a65aee830139de7814d29631 100644 (file)
@@ -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);