Re: [PATCH libdrm 01/11] libdrm: valgrind-clear a few more IOCTL arguments

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

 



Hi Thierry,

Thank you for the patch.

On Friday 23 January 2015 17:08:14 Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
> 
> Fixes a few complaints raised by valgrind when running the Tegra tests.
>
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>

I agree that a fix is needed, and that this patch matches the rest of the 
code, so

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

However, shouldn't structures be memset to 0 unconditionally, especially 
considering the recent discussion regarding reserved fields that should be 
initialized to default values by userspace ? This can be fixed by a separate 
patch.

> ---
>  xf86drmMode.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xf86drmMode.c b/xf86drmMode.c
> index 60ce3699f3e3..f6e4416b88b5 100644
> --- a/xf86drmMode.c
> +++ b/xf86drmMode.c
> @@ -282,6 +282,7 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t
> height, struct drm_mode_fb_cmd2 f;
>  	int ret;
> 
> +	VG_CLEAR(f);
>  	f.width  = width;
>  	f.height = height;
>  	f.pixel_format = pixel_format;
> @@ -309,6 +310,7 @@ drmModeFBPtr drmModeGetFB(int fd, uint32_t buf)
>  	struct drm_mode_fb_cmd info;
>  	drmModeFBPtr r;
> 
> +	VG_CLEAR(info);
>  	info.fb_id = buf;
> 
>  	if (drmIoctl(fd, DRM_IOCTL_MODE_GETFB, &info))

-- 
Regards,

Laurent Pinchart

_______________________________________________
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