Skip to content

Commit

Permalink
[media] uvcvideo: Return -ENOTTY for unsupported ioctls
Browse files Browse the repository at this point in the history
The proper error code is -ENOTTY instead of -EINVAL.
This issue was found by the v4l2-compliance tool.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Nov 28, 2012
1 parent f887e99 commit 69d1126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/usb/uvc/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)

case VIDIOC_G_CROP:
case VIDIOC_S_CROP:
return -EINVAL;
return -ENOTTY;

/* Buffers & streaming */
case VIDIOC_REQBUFS:
Expand Down Expand Up @@ -1038,7 +1038,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)

case VIDIOC_ENUMOUTPUT:
uvc_trace(UVC_TRACE_IOCTL, "Unsupported ioctl 0x%08x\n", cmd);
return -EINVAL;
return -ENOTTY;

case UVCIOC_CTRL_MAP:
return uvc_ioctl_ctrl_map(chain, arg);
Expand Down

0 comments on commit 69d1126

Please sign in to comment.