summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2022-01-05 10:37:00 +0800
committerSebastian Reichel <sre@kernel.org>2022-02-01 13:13:44 +0100
commit2b56a9a28a6bf09890a43161402948ed62963f36 (patch)
tree7ca439280528861d9a8a2c51b15304fec40fb840 /drivers/power
parentda5462a4dc446e7028e6d150a4b02684d1d3ea81 (diff)
downloadlinux-2b56a9a28a6bf09890a43161402948ed62963f36.tar.bz2
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: 25fd330370ac ("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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/cw2015_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index 0c87ad0dbf71..728e2a6cc9c3 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -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;