From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
Daniel Mentz <danielmentz@google.com>,
Hans Verkuil <hans.verkuil@cisco.com>,
stable@vger.kernel.org
Subject: Re: [PATCHv2 12/13] v4l2-compat-ioctl32.c: don't copy back the result for certain errors
Date: Tue, 30 Jan 2018 16:32:22 +0200 [thread overview]
Message-ID: <5974400.0qDhsOljgk@avalon> (raw)
In-Reply-To: <20180130102701.13664-13-hverkuil@xs4all.nl>
Hi Hans,
Thank you for the patch.
On Tuesday, 30 January 2018 12:27:00 EET Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> Some ioctls need to copy back the result even if the ioctl returned
> an error. However, don't do this for the error code -ENOTTY.
> It makes no sense in that cases.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Cc: <stable@vger.kernel.org> # for v4.15 and up
> ---
> drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index
> 7ee3777cbe9c..3a1fca1440ac 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -968,6 +968,9 @@ static long do_video_ioctl(struct file *file, unsigned
> int cmd, unsigned long ar set_fs(old_fs);
> }
>
> + if (err == -ENOTTY)
Should we also handle -ENOIOCTLCMD as in video_usercopy() ?
> + return err;
> +
> /* Special case: even after an error we need to put the
> results back for these ioctls since the error_idx will
> contain information on which control failed. */
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2018-01-30 14:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180130102701.13664-1-hverkuil@xs4all.nl>
2018-01-30 10:26 ` [PATCHv2 01/13] vivid: fix module load error when enabling fb and no_error_inj=1 Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 02/13] v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 03/13] v4l2-ioctl.c: don't copy back the result for -ENOTTY Hans Verkuil
2018-01-30 11:51 ` Sakari Ailus
2018-01-30 10:26 ` [PATCHv2 04/13] v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 05/13] v4l2-compat-ioctl32.c: fix the indentation Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 06/13] v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32 Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 07/13] v4l2-compat-ioctl32.c: avoid sizeof(type) Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 08/13] v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32 Hans Verkuil
2018-01-30 10:26 ` [PATCHv2 09/13] v4l2-compat-ioctl32.c: fix ctrl_is_pointer Hans Verkuil
2018-01-30 11:51 ` Sakari Ailus
2018-01-30 14:36 ` Laurent Pinchart
2018-01-30 10:26 ` [PATCHv2 10/13] v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32 Hans Verkuil
2018-01-30 11:50 ` Sakari Ailus
2018-01-30 14:28 ` Laurent Pinchart
2018-01-30 10:26 ` [PATCHv2 11/13] v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type Hans Verkuil
2018-01-30 10:27 ` [PATCHv2 12/13] v4l2-compat-ioctl32.c: don't copy back the result for certain errors Hans Verkuil
2018-01-30 14:32 ` Laurent Pinchart [this message]
2018-01-30 14:37 ` Hans Verkuil
2018-01-30 10:27 ` [PATCHv2 13/13] v4l2-compat-ioctl32.c: refactor, fix security bug in compat ioctl32 Hans Verkuil
2018-01-30 11:46 ` Sakari Ailus
2018-01-30 11:53 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5974400.0qDhsOljgk@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=danielmentz@google.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox