From 1d94aa369da073acff26fa98ad6b2168cb028ab1 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 6 Apr 2010 08:12:21 -0300 Subject: [PATCH] V4L/DVB: video_ioctl2: do not replace arg with NULL for _IO() ioctls If the ioctl was defined without direction (e.g. _IO('o', 25)), then the arg as passed to vidioc_default was NULL instead of the original argument. Several ioctls in e.g. include/linux/dvb/video.h and audio.h use this type of ioctl to pass simple numerical values to the driver. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 7d59c107f13..d6975f9c372 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -2006,7 +2006,7 @@ long video_ioctl2(struct file *file, { char sbuf[128]; void *mbuf = NULL; - void *parg = NULL; + void *parg = (void *)arg; long err = -EINVAL; int is_ext_ctrl; size_t ctrls_size = 0; -- 2.46.0