Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: uvc: fix interval_duration calculation

To correctly convert bInterval as interval_duration:
interval_duration = 2^(bInterval-1) * frame_interval

Current code uses a wrong left shift operand, computing 2^bInterval
instead of 2^(bInterval-1).

Fixes: 010dc57cb516 ("usb: gadget: uvc: fix interval_duration calculation")
Cc: stable <stable@kernel.org>
Signed-off-by: Junzhong Pan <panjunzhong@linux.spacemit.com>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260306-fix-uvc-interval-v1-1-9a2df6859859@linux.spacemit.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Junzhong Pan and committed by
Greg Kroah-Hartman
56135c0c ae4ff9de

+1 -1
+1 -1
drivers/usb/gadget/function/uvc_video.c
··· 513 513 return; 514 514 } 515 515 516 - interval_duration = 2 << (video->ep->desc->bInterval - 1); 516 + interval_duration = 1 << (video->ep->desc->bInterval - 1); 517 517 if (cdev->gadget->speed < USB_SPEED_HIGH) 518 518 interval_duration *= 10000; 519 519 else