From: Hans Verkuil Date: Tue, 30 Jan 2018 08:50:01 +0000 (-0500) Subject: media: v4l2-ioctl.c: don't copy back the result for -ENOTTY X-Git-Tag: v4.19~1636^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=181a4a2d5a0a7b43cab08a70710d727e7764ccdd;p=platform%2Fkernel%2Flinux-rpi.git media: v4l2-ioctl.c: don't copy back the result for -ENOTTY If the ioctl returned -ENOTTY, then don't bother copying back the result as there is no point. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Cc: # for v4.15 and up Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index c7f6b65..260288c 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2900,8 +2900,11 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, /* Handles IOCTL */ err = func(file, cmd, parg); - if (err == -ENOIOCTLCMD) + if (err == -ENOTTY || err == -ENOIOCTLCMD) { err = -ENOTTY; + goto out; + } + if (err == 0) { if (cmd == VIDIOC_DQBUF) trace_v4l2_dqbuf(video_devdata(file)->minor, parg);