summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-05-18 09:09:59 -0400
committerRobert Foss <robert.foss@collabora.com>2017-05-18 11:41:33 -0400
commit4ab45294d30cd77c630399e1e440a52d18b4f9ea (patch)
tree10f39ec17ee9b319065c051fd99eb2d4c211d42e
parentdfdc3e530d5c4b8feb080011080c32e7fe44358f (diff)
downloadgbm_gralloc-4ab45294d30cd77c630399e1e440a52d18b4f9ea.tar.gz
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 <robert.foss@collabora.com>
-rw-r--r--gralloc.cpp2
1 files changed, 1 insertions, 1 deletions
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;