From: Roland Dreier Date: Tue, 28 Jun 2005 16:11:49 +0000 (+0000) Subject: Free context before closing associated file descriptors X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b58c5ac0b7d0f2dfbcf3ecff76ac18829e993102;p=~shefty%2Flibibverbs.git Free context before closing associated file descriptors 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 --- diff --git a/src/device.c b/src/device.c index be16ea8..120507a 100644 --- a/src/device.c +++ b/src/device.c @@ -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; }