Commit 30ecb936 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] uvcvideo: Return -EACCES when trying to access a read/write-only control

The proper return code according to the V4L2 specification is -EACCES,
not -EINVAL.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f0ed2ce8
...@@ -927,7 +927,7 @@ static int __uvc_ctrl_get(struct uvc_video_chain *chain, ...@@ -927,7 +927,7 @@ static int __uvc_ctrl_get(struct uvc_video_chain *chain,
int ret; int ret;
if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0) if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
return -EINVAL; return -EACCES;
if (!ctrl->loaded) { if (!ctrl->loaded) {
ret = uvc_query_ctrl(chain->dev, UVC_GET_CUR, ctrl->entity->id, ret = uvc_query_ctrl(chain->dev, UVC_GET_CUR, ctrl->entity->id,
...@@ -1435,7 +1435,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, ...@@ -1435,7 +1435,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
if (ctrl == NULL) if (ctrl == NULL)
return -ENOENT; return -ENOENT;
if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR))
return -EINVAL; return -EACCES;
/* Clamp out of range values. */ /* Clamp out of range values. */
switch (mapping->v4l2_type) { switch (mapping->v4l2_type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment