mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 07:44:49 +01:00
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:
|
||
|---|---|---|
| .. | ||
| icc-emi.c | ||
| icc-emi.h | ||
| Kconfig | ||
| Makefile | ||
| mt8183.c | ||
| mt8195.c | ||
| mt8196.c | ||