tree 1361f0ca29e0a8d4e22fb508b7493db441007c7f
parent 2e8b981c5d5c6fe5479ad47c44e3e76ebb5408ef
author Roland Dreier <[EMAIL PROTECTED]> Mon, 15 Aug 2005 21:35:16 -0700
committer Roland Dreier <[EMAIL PROTECTED]> Sat, 27 Aug 2005 10:37:36 -0700

[PATCH] IB: unmap FMRs when destroying FMR pool

Make sure that all FMRs are unmapped before we deallocate them so that
we don't leak references to our protection domain when destroying an
FMR pool.  (Bug reported by Guy German <[EMAIL PROTECTED]>)

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>

 drivers/infiniband/core/fmr_pool.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff --git a/drivers/infiniband/core/fmr_pool.c 
b/drivers/infiniband/core/fmr_pool.c
--- a/drivers/infiniband/core/fmr_pool.c
+++ b/drivers/infiniband/core/fmr_pool.c
@@ -334,6 +334,7 @@ void ib_destroy_fmr_pool(struct ib_fmr_p
 {
        struct ib_pool_fmr *fmr;
        struct ib_pool_fmr *tmp;
+       LIST_HEAD(fmr_list);
        int                 i;
 
        kthread_stop(pool->thread);
@@ -341,6 +342,11 @@ void ib_destroy_fmr_pool(struct ib_fmr_p
 
        i = 0;
        list_for_each_entry_safe(fmr, tmp, &pool->free_list, list) {
+               if (fmr->remap_count) {
+                       INIT_LIST_HEAD(&fmr_list);
+                       list_add_tail(&fmr->fmr->list, &fmr_list);
+                       ib_unmap_fmr(&fmr_list);
+               }
                ib_dealloc_fmr(fmr->fmr);
                list_del(&fmr->list);
                kfree(fmr);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to