media: uvcvideo: Do not return positive errors in uvc_query_ctrl()
authorRicardo Ribalda <ribalda@chromium.org>
Tue, 3 Jan 2023 14:36:22 +0000 (15:36 +0100)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 15 Jan 2023 21:45:12 +0000 (23:45 +0200)
commita763b9fb58be869e252a7d33acb0a6390b01c801
tree177060bb352348ce8f1ed792fa4c6540b5786546
parent44cdba4130ecdb59ff94c617b6cd8dc22b4f3c97
media: uvcvideo: Do not return positive errors in uvc_query_ctrl()

If the returned size of the query does not match the expected size or it
is zero, return -EPIPE instead of 0 or a positive value.

This will avoid confusing the caller (and ultimately userspace) that
doesn't expect a positive or zero value.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/media/usb/uvc/uvc_video.c