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>
This commit is contained in:
parent
a578cc3af5
commit
966f655117
@ -263,13 +263,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* All supplies found, allocate char ** array for filling */
|
/* 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);
|
GFP_KERNEL);
|
||||||
if (!psy->supplied_from)
|
if (!psy->supplied_from)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
*psy->supplied_from = devm_kcalloc(&psy->dev,
|
*psy->supplied_from = devm_kcalloc(&psy->dev,
|
||||||
cnt - 1, sizeof(char *),
|
cnt - 1, sizeof(**psy->supplied_from),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!*psy->supplied_from)
|
if (!*psy->supplied_from)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user