From 4ab45294d30cd77c630399e1e440a52d18b4f9ea Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Thu, 18 May 2017 09:09:59 -0400 Subject: Return dup() of FD for GRALLOC_MODULE_PERFORM_GET_DRM_FD Prevent callers of GRALLOC_MODULE_PERFORM_GET_DRM_FD from sharing the same actual FD. Signed-off-by: Robert Foss --- gralloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gralloc.cpp b/gralloc.cpp index ad63a49..f3d91b7 100644 --- a/gralloc.cpp +++ b/gralloc.cpp @@ -110,7 +110,7 @@ static int gbm_mod_perform(const struct gralloc_module_t *mod, int op, ...) case GRALLOC_MODULE_PERFORM_GET_DRM_FD: { int *fd = va_arg(args, int *); - *fd = gbm_device_get_fd(dmod->gbm); + *fd = dup(gbm_device_get_fd(dmod->gbm)); err = 0; } break; -- cgit v1.2.3