[PATCH] drmPrime*: initialize output args to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix Valgrind errors because those memory was uninitialized.

https://bugs.freedesktop.org/show_bug.cgi?id=90194
Signed-off-by: Guillaume Desmottes <guillaume.desmottes@xxxxxxxxxxxxxxx>
---
 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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux