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>main
parent
454b149494
commit
4bca42fc50
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue