power: supply_core: fix application of sizeof to pointer
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Fixes 25fd330370ac ("power: supply_core: Pass pointer to battery info")
Signed-off-by Yang Li <[email protected]>
--- drivers/power/supply/cw2015_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/cw2015_battery.c +1 -1
@@ -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 ;
Signature · 1 line
2.20.1.7.g153144c
Quoted 7 lines · Yang Li
The coccinelle check report:
./drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of sizeof to pointerReported-by Abaci Robot <[email protected]>Fixes 25fd330370ac ("power: supply_core: Pass pointer to battery info")Signed-off-by Yang Li <[email protected]>
Reviewed-by Linus Walleij <[email protected]>
Thanks for finding this!
Yours,
Linus Walleij