[PATCH 5.10/5.15 1/2] power: supply: Fix typo in power_supply_check_supplies
From: Mikhail Dmitrichenko
Date: Mon Nov 02 2026 - 06:15:40 EST
From: Schspa Shi <schspa@xxxxxxxxx>
commit 966f6551173ac46183db6621451702a7e4a3d4b5 upstream.
It seems to be a typo, there is no actual BUG, but it's better to
fix it to avoid any possible BUG after we change the type of
supplied_from.
Signed-off-by: Schspa Shi <schspa@xxxxxxxxx>
Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
Stable-dep-of: ba61aed9a346 ("power: supply: core: fix supplied_from allocations")
Signed-off-by: Mikhail Dmitrichenko <mdmitrichenko@xxxxxxxxxxxxx>
---
Prerequisite for the CVE-2026-74271 fix.
drivers/power/supply/power_supply_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 61ba2b343b93..d63cd225d4d4 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -261,13 +261,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
return 0;
/* All supplies found, allocate char ** array for filling */
- psy->supplied_from = devm_kzalloc(&psy->dev, sizeof(psy->supplied_from),
+ psy->supplied_from = devm_kzalloc(&psy->dev, sizeof(*psy->supplied_from),
GFP_KERNEL);
if (!psy->supplied_from)
return -ENOMEM;
*psy->supplied_from = devm_kcalloc(&psy->dev,
- cnt - 1, sizeof(char *),
+ cnt - 1, sizeof(**psy->supplied_from),
GFP_KERNEL);
if (!*psy->supplied_from)
return -ENOMEM;
--
2.43.0