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: 25fd330370 ("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>
This commit is contained in:
Yang Li 2022-01-05 10:37:00 +08:00 committed by Sebastian Reichel
parent da5462a4dc
commit 2b56a9a28a

View File

@ -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;