media: uvcvideo: Annotate lock requirements for uvc_ctrl_set

Make it explicit that the function is always called with ctrl_mutex
being held.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-4-26c867231118@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Ricardo Ribalda 2024-12-03 21:20:11 +00:00 committed by Mauro Carvalho Chehab
parent 221cd51efe
commit 02baaa09d1

View File

@ -1981,6 +1981,8 @@ int uvc_ctrl_set(struct uvc_fh *handle,
s32 max;
int ret;
lockdep_assert_held(&chain->ctrl_mutex);
if (__uvc_query_v4l2_class(chain, xctrl->id, 0) >= 0)
return -EACCES;