Commit 2b56a9a2 authored by Yang Li's avatar Yang Li Committed by Sebastian Reichel

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: default avatarAbaci Robot <abaci@linux.alibaba.com>
Fixes: 25fd3303 ("power: supply_core: Pass pointer to battery info")
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent da5462a4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment