Commit 35419025 authored by Dan Carpenter's avatar Dan Carpenter Committed by Saeed Mahameed

net/mlx5: Unlock on error in mlx5_sriov_enable()

Unlock before returning if mlx5_device_enable_sriov() fails.

Fixes: 84a433a4 ("net/mlx5: Lock mlx5 devlink reload callbacks")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 21234e3a
......@@ -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) {
......
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