]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: supply: core: fix supplied_from allocations
authorLucas Tsai <lucas_tsai@richtek.com>
Tue, 9 Jun 2026 11:44:03 +0000 (19:44 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 12 Jun 2026 21:58:08 +0000 (23:58 +0200)
commitba61aed9a34671222d1149acfc2f0179a9ce7e80
tree464ebf38853b9032c6f88c482dd29ee315ffc459
parent4acc0138c4f2fba453da5a5076ad2bba08a7463b
power: supply: core: fix supplied_from allocations

If dts property power-supplies has multiple values, then accessing to
psy->supplied_from[i-1] in __power_supply_populate_supplied_from will
overrun supplied_from array.

Fixes: f6e0b081fb30 ("power_supply: Populate supplied_from hierarchy from the device tree")
Signed-off-by: Lucas Tsai <lucas_tsai@richtek.com>
Link: https://patch.msgid.link/20260609114403.3896073-1-lucas_tsai@richtek.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_core.c