]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: uvcvideo: Annotate lock requirements for uvc_ctrl_set
authorRicardo Ribalda <ribalda@chromium.org>
Tue, 3 Dec 2024 21:20:11 +0000 (21:20 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 14:44:43 +0000 (14:44 +0000)
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>
drivers/media/usb/uvc/uvc_ctrl.c

index 4837d8df9c0386d478109aaaffbbc32408eea90e..21d5c62d1ac122979f20c2dcf3a9c6d6cf525637 100644 (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;