[MTHCA] re-bugfix: perform memory deregistration in reverse order wrt. memory registr...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 10 Jul 2006 14:28:17 +0000 (14:28 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 10 Jul 2006 14:28:17 +0000 (14:28 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@415 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/mthca_provider.c

index 763d4b8..16a21d9 100644 (file)
@@ -1117,10 +1117,13 @@ int mthca_dereg_mr(struct ib_mr *mr)
        struct mthca_mr *mmr = to_mmr(mr);
        struct mthca_dev* dev = to_mdev(mr->device);
 
-       if (mr->pd->ucontext) 
+       if (mr->pd->ucontext) {
                MmUnsecureVirtualMemory ( mmr->secure_handle );
-       mthca_free_mr(dev, mmr);
-       iobuf_deregister(&mmr->iobuf);
+               mthca_free_mr(dev, mmr);
+               iobuf_deregister(&mmr->iobuf);
+       }
+       else
+               mthca_free_mr(dev, mmr);
        kfree(mmr);
        return 0;
 }