diff options
| author | Nicolas Frattaroli <nicolas.frattaroli@collabora.com> | 2025-11-24 12:07:02 +0100 |
|---|---|---|
| committer | Georgi Djakov <djakov@kernel.org> | 2025-12-21 13:59:54 +0200 |
| commit | 6ffd02b82243d9907b5f5d2c7a2fc6a62669eece (patch) | |
| tree | d2cc9a565b28a656c916fb3dee4cfcc48d184f5f /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 510f8214440c553e81774c5822437ccf154e9e38 (diff) | |
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: b45293799f75 ("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>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
