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

hw/mthca/kernel/mthca_provider.c

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