From: Hans Verkuil Date: Mon, 21 Jul 2014 10:50:39 +0000 (-0300) Subject: [media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt() X-Git-Tag: omap-for-v3.17/fixes-against-rc2~155^2~212 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48f2650a87ae462598cf0a3b4b34ee5f52c34869;p=pandora-kernel.git [media] v4l2-ioctl: don't set PRIV_MAGIC unconditionally in g_fmt() Regression fix: V4L2_PIX_FMT_PRIV_MAGIC should only be set for the VIDEO_CAPTURE and VIDEO_OUTPUT buffer types, and not for any others. In the case of the win format this overwrote a pointer value that is passed in from userspace. Just set it for V4L2_BUF_TYPE_VIDEO_CAPTURE and OUTPUT only. Set it before the callback is called, just as is done for try/s_fmt, and again afterwards in case the driver zeroed it. The latter was missing in try/s_fmt, so add it there as well. Currently it is quite likely that drivers clear priv (that was needed for a long time), so it makes sense to set it twice. Signed-off-by: Hans Verkuil Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed