Skip to content

Commit 2b56a9a

Browse files
Yang Lisre
authored andcommitted
power: supply: core: fix application of sizeof to pointer
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>
1 parent da5462a commit 2b56a9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/power/supply/cw2015_battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ static int cw_bat_probe(struct i2c_client *client)
689689
if (ret) {
690690
/* Allocate an empty battery */
691691
cw_bat->battery = devm_kzalloc(&client->dev,
692-
sizeof(cw_bat->battery),
692+
sizeof(*cw_bat->battery),
693693
GFP_KERNEL);
694694
if (!cw_bat->battery)
695695
return -ENOMEM;

0 commit comments

Comments
 (0)