media: v4l2-ioctl.c: don't copy back the result for -ENOTTY

commit 181a4a2d5a0a7b43cab08a70710d727e7764ccdd upstream.

If the ioctl returned -ENOTTY, then don't bother copying
back the result as there is no point.

Change-Id: I88b433a1623358b5e2e368ad391534da1e88f04a
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Hans Verkuil 2018-02-14 12:59:26 +01:00 committed by syphyr
parent b374f278f9
commit 72cb1fb398

View file

@ -2397,8 +2397,10 @@ 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 (has_array_args) {
*kernel_ptr = user_ptr;