linux/drivers/usb
John Keeping f2f69bf65d usb: gadget: u_audio: fix calculations for small bInterval
If bInterval is 1, then p_interval is 8000 and p_interval_mil is 8E9,
which is too big for a 32-bit value.  While the storage is indeed
64-bit, this value is used as the divisor in do_div() which will
truncate it into a uint32_t leading to incorrect calculated values.

Switch back to keeping the base value in struct snd_uac_chip which fits
easily into an int, meaning that the division can be done in two steps
with the divisor fitting safely into a uint32_t on both steps.

Fixes: 6fec018a7e ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback")
Tested-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20220104183243.718258-1-john@metanate.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-06 15:28:45 +01:00
..
atm usb: atm: Use struct_size() helper 2021-10-05 12:50:22 +02:00
c67x00
cdns3 headers/prep: Fix non-standard header section: drivers/usb/cdns3/core.h 2022-01-05 16:17:31 +01:00
chipidea usb: chipidea: Set the DT node on the child device 2021-12-17 16:52:27 +01:00
class Merge 5.15-rc5 into usb-next 2021-10-11 07:39:38 +02:00
common USB: common: debug: add needed kernel.h include 2022-01-05 16:20:27 +01:00
core USB: core: Fix bug in resuming hub's handling of wakeup requests 2022-01-03 14:40:39 +01:00
dwc2 usb: dwc2: gadget: initialize max_speed from params 2022-01-06 15:28:12 +01:00
dwc3 usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe 2022-01-06 15:26:21 +01:00
early Revert "usb: early: convert to readl_poll_timeout_atomic()" 2021-12-17 16:29:11 +01:00
gadget usb: gadget: u_audio: fix calculations for small bInterval 2022-01-06 15:28:45 +01:00
host headers/prep: Fix non-standard header section: drivers/usb/host/ohci-tmio.c 2022-01-05 16:18:11 +01:00
image scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions 2021-10-16 21:32:16 -04:00
isp1760 usb: isp1760: Use platform_get_irq() to get the interrupt 2021-12-21 08:51:57 +01:00
misc usb: misc: ehset: Rework test mode entry 2021-12-17 17:02:04 +01:00
mon
mtu3 usb: mtu3: set interval of FS intr and isoc endpoint 2021-12-21 09:05:45 +01:00
musb usb: musb: dsps: Use platform_get_irq_byname() to get the interrupt 2021-12-21 08:51:57 +01:00
phy usb: Remove redundant 'flush_workqueue()' calls 2021-11-17 14:36:57 +01:00
renesas_usbhs usb: renesas_usbhs: Use platform_get_irq() to get the interrupt 2021-12-21 08:51:57 +01:00
roles
serial USB: serial: option: add Telit FN990 compositions 2021-12-14 09:22:06 +01:00
storage usb-storage: Remove redundant assignments 2021-12-30 12:10:17 +01:00
typec Merge 5.16-rc8 into usb-next 2022-01-03 13:02:29 +01:00
usbip usb: Remove redundant 'flush_workqueue()' calls 2021-11-17 14:36:57 +01:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile usb: host: remove line for obsolete config USB_HWA_HCD 2021-08-18 15:32:19 +02:00
usb-skeleton.c usb: usb-skeleton: Update min() to min_t() 2021-10-05 12:56:48 +02:00