RDMA/rxe: Warn if mcast memory is not freed
authorBob Pearson <rpearsonhpe@gmail.com>
Wed, 23 Feb 2022 23:07:03 +0000 (17:07 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 24 Feb 2022 00:29:15 +0000 (20:29 -0400)
Print a warning if memory allocated by mcast
is not cleared when the rxe driver is unloaded.

Link: https://lore.kernel.org/r/20220223230706.50332-2-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe.c

index 3520eb2..fce3994 100644 (file)
@@ -29,6 +29,8 @@ void rxe_dealloc(struct ib_device *ib_dev)
        rxe_pool_cleanup(&rxe->mr_pool);
        rxe_pool_cleanup(&rxe->mw_pool);
 
+       WARN_ON(!RB_EMPTY_ROOT(&rxe->mcg_tree));
+
        if (rxe->tfm)
                crypto_free_shash(rxe->tfm);
 }