From 8a981d6bcf672c85d4f0bc6bb4aef50b584ed32d Mon Sep 17 00:00:00 2001 From: nith1989 Date: Thu, 18 Mar 2021 14:57:08 +0800 Subject: [PATCH] Fix fence fd leak issue: - close fence fd when destroy context Change-Id: I4ec1fe1c2f7de3221802ea53c3e563471cd1a332 Signed-off-by: Tianhao Ni --- src/gallium/drivers/v3d/v3d_context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/v3d/v3d_context.c b/src/gallium/drivers/v3d/v3d_context.c index 1fa7295..90f4719 100644 --- a/src/gallium/drivers/v3d/v3d_context.c +++ b/src/gallium/drivers/v3d/v3d_context.c @@ -292,6 +292,13 @@ v3d_context_destroy(struct pipe_context *pctx) v3d_program_fini(pctx); + if (v3d->screen->has_syncobj) { + drmSyncobjDestroy(v3d->fd, v3d->out_sync); + drmSyncobjDestroy(v3d->fd, v3d->in_syncobj); + } + if (v3d->in_fence_fd >= 0) + close(v3d->in_fence_fd); + ralloc_free(v3d); } -- 2.7.4