mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[media] uvcvideo: Return -EACCES when trying to set a read-only control
Commit ba68c8530a263dc4de440fa10bb20a1c5b9d4ff5 (Partly revert "[media]
uvcvideo: Set error_idx properly for extended controls API failures")
also reverted part of commit 30ecb936cb
("uvcvideo: Return -EACCES when trying to access a read/write-only
control") by mistake. Fix it.
Signed-off-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
734d1ece37
commit
9bf42300e6
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue