Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bde6e30 authored by Eli Cohen's avatar Eli Cohen Committed by Roland Dreier
Browse files

IB/mlx5: Abort driver cleanup if teardown hca fails



Do not continue with cleanup flow. If this ever happens we can check which
resources remained open.

Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 9e9c47d0
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -460,7 +460,10 @@ int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev)

err_stop_poll:
	mlx5_stop_health_poll(dev);
	mlx5_cmd_teardown_hca(dev);
	if (mlx5_cmd_teardown_hca(dev)) {
		dev_err(&dev->pdev->dev, "tear_down_hca failed, skip cleanup\n");
		return err;
	}

err_pagealloc_stop:
	mlx5_pagealloc_stop(dev);
@@ -503,7 +506,10 @@ void mlx5_dev_cleanup(struct mlx5_core_dev *dev)
	mlx5_eq_cleanup(dev);
	mlx5_disable_msix(dev);
	mlx5_stop_health_poll(dev);
	mlx5_cmd_teardown_hca(dev);
	if (mlx5_cmd_teardown_hca(dev)) {
		dev_err(&dev->pdev->dev, "tear_down_hca failed, skip cleanup\n");
		return;
	}
	mlx5_pagealloc_stop(dev);
	mlx5_reclaim_startup_pages(dev);
	mlx5_core_disable_hca(dev);