diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2015-04-29 10:16:22 +0200 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-05-28 15:58:34 +0100 |
commit | 4bca42fc504a2051964030daaa49b5ac49bb64d3 (patch) | |
tree | de3928eae784ee1c517465ec7016ecdda3afa316 | |
parent | 454b14949452c4e44990a8f455bcc307306181bc (diff) |
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 <guillaume.desmottes@collabora.co.uk>
v2: Explicitly zero the whole struct using memclear.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | xf86drm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2721,6 +2721,8 @@ int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd) struct drm_prime_handle args; int ret; + memclear(args); + args.fd = -1; args.handle = handle; args.flags = flags; ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args); @@ -2736,8 +2738,8 @@ int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle) struct drm_prime_handle args; int ret; + memclear(args); args.fd = prime_fd; - args.flags = 0; ret = drmIoctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args); if (ret) return ret; |