linux-stable/drivers
Lareine Khawaly ed173f77fd i2c: designware: use casting of u64 in clock multiplication to avoid overflow
[ Upstream commit c8c37bc514 ]

In functions i2c_dw_scl_lcnt() and i2c_dw_scl_hcnt() may have overflow
by depending on the values of the given parameters including the ic_clk.
For example in our use case where ic_clk is larger than one million,
multiplication of ic_clk * 4700 will result in 32 bit overflow.

Add cast of u64 to the calculation to avoid multiplication overflow, and
use the corresponding define for divide.

Fixes: 2373f6b974 ("i2c-designware: split of i2c-designware.c into core and bus specific parts")
Signed-off-by: Lareine Khawaly <lareine@amazon.com>
Signed-off-by: Hanna Hawa <hhhawa@amazon.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-01 08:23:23 +01:00
..
accessibility
acpi ACPICA: Fix error code path in acpi_ds_call_control_method() 2023-01-14 10:16:14 +01:00
amba
android
ata ata: ahci: Fix PCS quirk application for suspend 2023-01-14 10:16:25 +01:00
atm
auxdisplay
base driver core: Fix test_async_probe_init saves device in wrong array 2023-02-01 08:23:15 +01:00
bcma
block drbd: fix an invalid memory access caused by incorrect use of list iterator 2023-01-14 10:15:32 +01:00
bluetooth Bluetooth: hci_qca: Fixed issue during suspend 2023-01-24 07:20:01 +01:00
bus bus: mhi: host: Fix race between channel preparation and M0 event 2023-01-18 11:44:55 +01:00
cdrom
char ipmi: fix use after free in _ipmi_destroy_user() 2023-01-14 10:16:35 +01:00
clk clk: Provide new devm_clk helpers for prepared and enabled clocks 2023-02-01 08:23:08 +01:00
clocksource
connector
counter counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update 2023-01-14 10:15:58 +01:00
cpufreq cpufreq: armada-37xx: stop using 0 as NULL pointer 2023-02-01 08:23:17 +01:00
cpuidle
crypto crypto: n2 - add missing hash statesize 2023-01-14 10:16:36 +01:00
dax
dca
devfreq PM/devfreq: governor: Add a private governor_data for governor 2023-01-14 10:16:31 +01:00
dio drivers: dio: fix possible memory leak in dio_init() 2023-01-14 10:15:54 +01:00
dma dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node() 2023-02-01 08:23:15 +01:00
dma-buf
edac EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info 2023-02-01 08:23:23 +01:00
eisa
extcon
firewire
firmware firmware: arm_scmi: Harden shared memory access in fetch_notification 2023-02-01 08:23:10 +01:00
fpga
fsi
gnss
gpio gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode 2023-02-01 08:23:12 +01:00
gpu drm: Add orientation quirk for Lenovo ideapad D330-10IGL 2023-02-01 08:23:16 +01:00
greybus
hid HID: betop: check shape of output reports 2023-02-01 08:23:15 +01:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2023-01-14 10:16:03 +01:00
hv video: hyperv_fb: Avoid taking busy spinlock on panic path 2023-01-14 10:16:13 +01:00
hwmon hwmon: (jc42) Fix missing unlock on error in jc42_write() 2023-01-14 10:16:20 +01:00
hwspinlock
hwtracing
i2c i2c: designware: use casting of u64 in clock multiplication to avoid overflow 2023-02-01 08:23:23 +01:00
i3c
ide
idle
iio iio: adc128s052: add proper .data members in adc128_of_match table 2023-01-14 10:16:24 +01:00
infiniband IB/hfi1: Remove user expected buffer invalidate race 2023-02-01 08:23:11 +01:00
input Input: elants_i2c - properly handle the reset GPIO when power is off 2023-01-14 10:15:30 +01:00
interconnect
iommu iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:45:00 +01:00
ipack
irqchip
isdn mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2023-01-14 10:16:10 +01:00
leds
lightnvm
macintosh macintosh/macio-adb: check the return value of ioremap() 2023-01-14 10:16:06 +01:00
mailbox mailbox: zynq-ipi: fix error handling while device_register() fails 2023-01-14 10:16:12 +01:00
mcb mcb: mcb-parse: fix error handing in chameleon_parse_gdd() 2023-01-14 10:15:59 +01:00
md md/bitmap: Fix bitmap chunk size overflow issues 2023-01-14 10:16:34 +01:00
media media: s5p-mfc: Fix in register read and write for H264 2023-01-14 10:16:41 +01:00
memory memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() 2023-02-01 08:23:08 +01:00
memstick
message
mfd
misc mei: me: add meteor lake point M DID 2023-01-24 07:20:00 +01:00
mmc mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting 2023-01-24 07:19:59 +01:00
most
mtd mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type() 2023-01-14 10:16:35 +01:00
mux
net net: dsa: microchip: ksz9477: port map correction in ALU table entry register 2023-02-01 08:23:16 +01:00
nfc nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() 2023-01-18 11:44:59 +01:00
ntb
nubus
nvdimm
nvme nvme-pci: fix timeout request state check 2023-02-01 08:23:15 +01:00
nvmem
of of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop() 2023-01-14 10:15:42 +01:00
opp
oprofile
parisc parisc: led: Fix potential null-ptr-deref in start_task() 2023-01-14 10:16:36 +01:00
parport
pci PCI/sysfs: Fix double free in error path 2023-01-14 10:16:36 +01:00
pcmcia
perf
phy phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in rockchip_usb2phy_power_on() 2023-02-01 08:23:12 +01:00
pinctrl pinctrl: pinconf-generic: add missing of_node_put() 2023-01-14 10:15:32 +01:00
platform platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK 2023-02-01 08:23:17 +01:00
pnp
power power: supply: fix null pointer dereferencing in power_supply_get_battery_info 2023-01-14 10:16:03 +01:00
powercap
pps
ps3
ptp
pwm pwm: tegra: Fix 32 bit build 2023-01-14 10:16:24 +01:00
rapidio
ras
regulator regulator: da9211: Use irq handler when ready 2023-01-18 11:44:58 +01:00
remoteproc remoteproc: core: Do pm_relax when in RPROC_OFFLINE state 2023-01-14 10:16:36 +01:00
reset
rpmsg
rtc rtc: ds1347: fix value written to century register 2023-01-14 10:16:34 +01:00
s390 s390/lcs: Fix return type of lcs_start_xmit() 2023-01-14 10:16:17 +01:00
sbus
scsi scsi: hpsa: Fix allocation size for scsi_host_alloc() 2023-02-01 08:23:21 +01:00
sfi
sh
siox
slimbus
soc PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() 2023-02-01 08:23:11 +01:00
soundwire ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2023-01-14 10:16:28 +01:00
spi spi: spidev: remove debug messages that access spidev->spi without locking 2023-02-01 08:23:17 +01:00
spmi
ssb
staging comedi: adv_pci1760: Fix PWM instruction handling 2023-01-24 07:19:59 +01:00
target
tc
tee
thermal thermal: intel: int340x: Protect trip temperature from concurrent updates 2023-02-01 08:23:22 +01:00
thunderbolt thunderbolt: Use correct function to calculate maximum USB3 link rate 2023-01-24 07:19:59 +01:00
tty serial: atmel: fix incorrect baudrate setup 2023-01-24 07:20:00 +01:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2023-01-14 10:15:55 +01:00
usb xhci: Set HCD flag to defer primary roothub registration 2023-02-01 08:23:21 +01:00
vdpa
vfio vfio: platform: Do not pass return buffer to ACPI _RST method 2023-01-14 10:15:54 +01:00
vhost vhost: fix range used in translate_desc() 2023-01-14 10:16:46 +01:00
video fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB 2023-01-14 10:16:49 +01:00
virt
virtio
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-14 10:16:00 +01:00
w1 w1: fix WARNING after calling w1_process() 2023-02-01 08:23:15 +01:00
watchdog
xen
zorro
Kconfig
Makefile