Module: Mesa
Branch: master
Commit: ab51cd2f26496500d52f6b2847291d884f711bc2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab51cd2f26496500d52f6b2847291d884f711bc2

Author: Philipp Zabel <[email protected]>
Date:   Thu Apr 27 18:44:01 2017 +0200

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]>

---

 src/gallium/auxiliary/renderonly/renderonly.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/renderonly/renderonly.c 
b/src/gallium/auxiliary/renderonly/renderonly.c
index 7e23769159..e17c32886d 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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to