From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Subject: [PATCH 1/3] uvcvideo: Return -EACCES when trying to access a read/write-only control
Date: Fri, 11 Jan 2013 14:13:58 +0100 [thread overview]
Message-ID: <1357910040-27463-2-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1357910040-27463-1-git-send-email-laurent.pinchart@ideasonboard.com>
Commit ba68c8530a263dc4de440fa10bb20a1c5b9d4ff5 (Partly revert "[media]
uvcvideo: Set error_idx properly for extended controls API failures")
also reverted commit 30ecb936cbcd83e3735625ac63e1b4466546f5fe
("uvcvideo: Return -EACCES when trying to access a read/write-only
control") by mistake. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/usb/uvc/uvc_ctrl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 2bb7613..d5baab1 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1431,8 +1431,10 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
int ret;
ctrl = uvc_find_control(chain, xctrl->id, &mapping);
- if (ctrl == NULL || (ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR) == 0)
+ if (ctrl == NULL)
return -EINVAL;
+ if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR))
+ return -EACCES;
/* Clamp out of range values. */
switch (mapping->v4l2_type) {
--
1.7.8.6
next prev parent reply other threads:[~2013-01-11 13:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 13:13 [PATCH 0/3] Fix uvcvideo revert leftovers Laurent Pinchart
2013-01-11 13:13 ` Laurent Pinchart [this message]
2013-01-11 13:21 ` [PATCH 1/3] uvcvideo: Return -EACCES when trying to access a read/write-only control Hans Verkuil
2013-01-11 13:26 ` Hans Verkuil
2013-01-11 13:31 ` Laurent Pinchart
2013-01-11 13:13 ` [PATCH 2/3] uvcvideo: Cleanup leftovers of partial revert Laurent Pinchart
2013-01-11 13:22 ` Hans Verkuil
2013-01-11 13:14 ` [PATCH 3/3] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures Laurent Pinchart
2013-01-11 13:27 ` 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=1357910040-27463-2-git-send-email-laurent.pinchart@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@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;
as well as URLs for NNTP newsgroup(s).