Skip to content

Commit

Permalink
power: supply: core: fix application of sizeof to pointer
Browse files Browse the repository at this point in the history
The coccinelle check report:
./drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of
sizeof to pointer

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 25fd330 ("power: supply_core: Pass pointer to battery info")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
  • Loading branch information
Yang Li authored and Sebastian Reichel committed Feb 1, 2022
1 parent da5462a commit 2b56a9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/cw2015_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ static int cw_bat_probe(struct i2c_client *client)
if (ret) {
/* Allocate an empty battery */
cw_bat->battery = devm_kzalloc(&client->dev,
sizeof(cw_bat->battery),
sizeof(*cw_bat->battery),
GFP_KERNEL);
if (!cw_bat->battery)
return -ENOMEM;
Expand Down

0 comments on commit 2b56a9a

Please sign in to comment.