aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-12-03 21:20:11 +0000
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-12-19 14:44:43 +0000
commit02baaa09d1cb32eaaed74135cab15155ffd7b953 (patch)
tree6ebf5b0a6638e5734e60745fe03437f6e9ab1f5a
parentmedia: uvcvideo: Remove dangling pointers (diff)
downloadwireguard-linux-02baaa09d1cb32eaaed74135cab15155ffd7b953.tar.xz
wireguard-linux-02baaa09d1cb32eaaed74135cab15155ffd7b953.zip
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>
-rw-r--r--drivers/media/usb/uvc/uvc_ctrl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 4837d8df9c03..21d5c62d1ac1 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -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;