linux/drivers/interconnect
Nicolas Frattaroli 6ffd02b822 interconnect: mediatek: Aggregate bandwidth with saturating add
By using a regular non-overflow-checking add, the MediaTek icc-emi
driver will happy wrap at U32_MAX + 1 to 0. As it's common for the
interconnect core to fill in INT_MAX values, this is not a hypothetical
situation, but something that actually happens in regular use. This
would be pretty disasterous if anything used this driver.

Replace the addition with an overflow-checked addition from overflow.h,
and saturate to U32_MAX if an overflow is detected.

Fixes: b45293799f ("interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Link: https://lore.kernel.org/r/20251124-mt8196-dvfsrc-v2-13-d9c1334db9f3@collabora.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-12-21 13:59:54 +02:00
..
imx interconnect: Switch back to struct platform_driver::remove() 2024-10-22 12:34:18 +03:00
mediatek interconnect: mediatek: Aggregate bandwidth with saturating add 2025-12-21 13:59:54 +02:00
qcom interconnect: qcom: sm6350: enable QoS configuration 2025-11-19 16:03:12 +02:00
samsung interconnect: exynos: handle node name allocation failure 2025-06-23 17:59:09 +03:00
bulk.c interconnect: add device managed bulk API 2022-07-04 16:14:29 +03:00
core.c interconnect: core: Use device_match_of_node() 2025-09-12 13:53:12 +03:00
debugfs-client.c interconnect: debugfs: Fix incorrect error handling for NULL path 2025-10-31 02:53:58 +02:00
icc-clk.c interconnect: icc-clk: destroy nodes in case of memory allocation failures 2025-06-26 19:18:01 +03:00
internal.h Merge branch 'icc-debugfs' into icc-next 2023-08-22 21:05:09 +03:00
Kconfig interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver 2024-06-13 14:31:43 +03:00
Makefile interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver 2024-06-13 14:31:43 +03:00
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00