diff options
author | Philipp Zabel <[email protected]> | 2017-04-27 18:44:01 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-05-02 22:19:19 +0200 |
commit | ab51cd2f26496500d52f6b2847291d884f711bc2 (patch) | |
tree | 065af843f6aa3a0056d1d72c0842ac6518527d5a /src | |
parent | 09034aab64c7a6022a2c508658fead1442f08576 (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]>
Diffstat (limited to 'src')
-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; |