]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Free context before closing associated file descriptors
authorRoland Dreier <rolandd@cisco.com>
Tue, 28 Jun 2005 16:11:49 +0000 (16:11 +0000)
committerRoland Dreier <rolandd@cisco.com>
Thu, 9 Nov 2006 19:35:56 +0000 (11:35 -0800)
Free context before closing associated file descriptors.  This can
avoid some problems acquiring mmap_sem when there is still memory to
be released by the kernel.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/device.c

index be16ea83e93c9ff79d6ba0ede0e05ae0ca8e0f1d..120507a5d17a9a7b08adb1e880c8a8cf80fae76b 100644 (file)
@@ -118,13 +118,13 @@ int ibv_close_device(struct ibv_context *context)
 {
        int i;
 
+       context->device->ops.free_context(context);
+
        close(context->async_fd);
        for (i = 0; i < context->num_comp; ++i)
                close(context->cq_fd[i]);
        close(context->cmd_fd);
 
-       context->device->ops.free_context(context);
-
        return 0;
 }