]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
media: uvcvideo: Fix event flags in uvc_ctrl_send_events
authorRicardo Ribalda <ribalda@chromium.org>
Thu, 14 Nov 2024 19:10:30 +0000 (19:10 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 14:44:43 +0000 (14:44 +0000)
If there is an event that needs the V4L2_EVENT_CTRL_CH_FLAGS flag, all
the following events will have that flag, regardless if they need it or
not.

This is because we keep using the same variable all the time and we do
not reset its original value.

Cc: stable@vger.kernel.org
Fixes: 805e9b4a06bf ("[media] uvcvideo: Send control change events for slave ctrls when the master changes")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241114-uvc-roi-v15-1-64cfeb56b6f8@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 4fe26e82e3d1c167bd59c5decf79a8391ae465a4..bab9fdac98e6306b2518f4e7b9b44df86a50b346 100644 (file)
@@ -1673,13 +1673,13 @@ static void uvc_ctrl_send_events(struct uvc_fh *handle,
 {
        struct uvc_control_mapping *mapping;
        struct uvc_control *ctrl;
-       u32 changes = V4L2_EVENT_CTRL_CH_VALUE;
        unsigned int i;
        unsigned int j;
 
        for (i = 0; i < xctrls_count; ++i) {
-               ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping);
+               u32 changes = V4L2_EVENT_CTRL_CH_VALUE;
 
+               ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping);
                if (ctrl->info.flags & UVC_CTRL_FLAG_ASYNCHRONOUS)
                        /* Notification will be sent from an Interrupt event. */
                        continue;