Skip to content

Commit

Permalink
net/mlx5: Unlock on error in mlx5_sriov_enable()
Browse files Browse the repository at this point in the history
Unlock before returning if mlx5_device_enable_sriov() fails.

Fixes: 84a433a ("net/mlx5: Lock mlx5 devlink reload callbacks")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Dan Carpenter authored and Saeed Mahameed committed Aug 22, 2022
1 parent 21234e3 commit 3541902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ static int mlx5_sriov_enable(struct pci_dev *pdev, int num_vfs)

devl_lock(devlink);
err = mlx5_device_enable_sriov(dev, num_vfs);
devl_unlock(devlink);
if (err) {
mlx5_core_warn(dev, "mlx5_device_enable_sriov failed : %d\n", err);
return err;
}
devl_unlock(devlink);

err = pci_enable_sriov(pdev, num_vfs);
if (err) {
Expand Down

0 comments on commit 3541902

Please sign in to comment.