Skip to content

Commit

Permalink
power: supply: Fix typo in power_supply_check_supplies
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Schspa Shi authored and Sebastian Reichel committed Jul 16, 2022
1 parent a578cc3 commit 966f655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/supply/power_supply_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 966f655

Please sign in to comment.