linux/drivers/interconnect
Nicolas Frattaroli 525858eb00 interconnect: mediatek: Aggregate bandwidth with saturating add
[ Upstream commit 6ffd02b822 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:20:28 -05:00
..
imx interconnect: imx: add missing MODULE_DESCRIPTION() macros 2024-06-13 16:12:10 +03:00
mediatek interconnect: mediatek: Aggregate bandwidth with saturating add 2026-03-04 07:20:28 -05:00
qcom interconnect: qcom: sdx75: Drop QPIC interconnect and BCM nodes 2026-01-08 10:14:30 +01:00
samsung interconnect: constify of_phandle_args in xlate 2024-02-26 00:38:17 +02:00
bulk.c interconnect: add device managed bulk API 2022-07-04 16:14:29 +03:00
core.c interconnect fixes for v6.9-rc 2024-04-11 14:44:49 +02:00
debugfs-client.c interconnect: debugfs: initialize src_node and dst_node to empty strings 2026-01-30 10:28:41 +01:00
icc-clk.c interconnect: icc-clk: Add missed num_nodes initialization 2024-08-23 18:40:00 +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