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>
{
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;
}