summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchspa Shi <schspa@gmail.com>2022-07-05 11:32:44 +0800
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-07-17 00:42:18 +0200
commit966f6551173ac46183db6621451702a7e4a3d4b5 (patch)
tree9e818420ce2e51620691690d51e0efa951f1a5fb
parenta578cc3af5cea5c7a912d2cfb8601875eb8ce451 (diff)
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 <schspa@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/supply/power_supply_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index fad5890c899e..02228d68c599 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;