summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xf86drm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 0a66a4a3..49da9c70 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -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;