Skip to content

Commit c31cffd

Browse files
ribaldamchehab
authored andcommitted
media: uvcvideo: Fix event flags in uvc_ctrl_send_events
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: 805e9b4 ("[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>
1 parent a67f75c commit c31cffd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/media/usb/uvc/uvc_ctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,13 +1673,13 @@ static void uvc_ctrl_send_events(struct uvc_fh *handle,
16731673
{
16741674
struct uvc_control_mapping *mapping;
16751675
struct uvc_control *ctrl;
1676-
u32 changes = V4L2_EVENT_CTRL_CH_VALUE;
16771676
unsigned int i;
16781677
unsigned int j;
16791678

16801679
for (i = 0; i < xctrls_count; ++i) {
1681-
ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping);
1680+
u32 changes = V4L2_EVENT_CTRL_CH_VALUE;
16821681

1682+
ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping);
16831683
if (ctrl->info.flags & UVC_CTRL_FLAG_ASYNCHRONOUS)
16841684
/* Notification will be sent from an Interrupt event. */
16851685
continue;

0 commit comments

Comments
 (0)