From b58c5ac0b7d0f2dfbcf3ecff76ac18829e993102 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 28 Jun 2005 16:11:49 +0000 Subject: [PATCH] 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 --- src/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.46.0