diff options
author | Philipp Zabel <[email protected]> | 2017-04-27 18:44:01 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-05-05 19:35:08 +0100 |
commit | 63d75fbfe31bc5a0227d2036d24f37d4aa941fa2 (patch) | |
tree | a7513e4552ad9082e4ba928146ddde48ab3c11a2 /src/gallium/auxiliary | |
parent | cabca7185b3924837a396094ef52f0bfc351f800 (diff) |
renderonly: close transfer prime_fd
prime_fd is only used to transfer the scanout buffer to the GPU inside
renderonly_create_kms_dumb_buffer_for_resource. It should be closed
immediately to avoid leaking the DMA-BUF file handle.
Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
(cherry picked from commit ab51cd2f26496500d52f6b2847291d884f711bc2)
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/renderonly/renderonly.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c index 7e23769159d..e17c32886d2 100644 --- a/src/gallium/auxiliary/renderonly/renderonly.c +++ b/src/gallium/auxiliary/renderonly/renderonly.c @@ -116,6 +116,8 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, scanout->prime = screen->resource_from_handle(screen, rsc, &handle, PIPE_HANDLE_USAGE_READ_WRITE); + close(prime_fd); + if (!scanout->prime) { fprintf(stderr, "failed to create resource_from_handle: %s\n", strerror(errno)); goto free_dumb; |