From: Schspa Shi Date: Tue, 5 Jul 2022 03:32:44 +0000 (+0800) Subject: power: supply: Fix typo in power_supply_check_supplies X-Git-Tag: v6.6.17~6798^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=966f6551173ac46183db6621451702a7e4a3d4b5;p=platform%2Fkernel%2Flinux-rpi.git power: supply: Fix typo in power_supply_check_supplies 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 Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index fad5890..02228d6 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -263,13 +263,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;