IB/mlx5: Clear umr resources after ib_unregister_device
authorEli Cohen <eli@dev.mellanox.co.il>
Sun, 14 Sep 2014 13:47:50 +0000 (16:47 +0300)
committerRoland Dreier <roland@purestorage.com>
Thu, 9 Oct 2014 07:08:40 +0000 (00:08 -0700)
Some ULPs may make use of resources created in create_umr_res so make sure to
call destroy_umrc_res after returning from ib_unregister_device, which makes
sure all ULPs have closed their resources.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx5/main.c

index d8907b20522abcb8eb46b0266a8495523eb241f2..ecd3aebc46fe29692053c1afeb6e4f3f8cc982d0 100644 (file)
@@ -1414,8 +1414,8 @@ err_dealloc:
 static void mlx5_ib_remove(struct mlx5_core_dev *mdev, void *context)
 {
        struct mlx5_ib_dev *dev = context;
-       destroy_umrc_res(dev);
        ib_unregister_device(&dev->ib_dev);
+       destroy_umrc_res(dev);
        destroy_dev_resources(&dev->devr);
        free_comp_eqs(dev);
        ib_dealloc_device(&dev->ib_dev);