From 6d77f74c60a9adeafc1d779981d797559a194462 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 27 Apr 2015 15:48:23 +0200 Subject: [PATCH] drmPrime*: initialize output args to 0 Fix Valgrind errors because those memory was uninitialized. https://bugs.freedesktop.org/show_bug.cgi?id=90194 Signed-off-by: Guillaume Desmottes --- xf86drm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index f7c45f8..01c398e 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2724,6 +2724,7 @@ int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd) struct drm_prime_handle args; int ret; + args.fd = -1; args.handle = handle; args.flags = flags; ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); @@ -2739,6 +2740,7 @@ int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle) struct drm_prime_handle args; int ret; + args.handle = 0; args.fd = prime_fd; args.flags = 0; ret = drmIoctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args); -- 2.1.0