[<prev] [next>] [day] [month] [year] [list]
Message-Id: <a45647609e9d87e8fee643920b1479492956df2a.1644837424.git.yang.guang5@zte.com.cn>
Date: Tue, 15 Feb 2022 08:53:11 +0800
From: davidcomponentone@...il.com
To: t.schramm@...jaro.org
Cc: davidcomponentone@...il.com, sre@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Yang Guang <yang.guang5@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] power: supply: cw2015: Fix application of sizeof to pointer
From: Yang Guang <yang.guang5@....com.cn>
The coccinelle check report:
./drivers/power/supply/cw2015_battery.c:692:12-18:
ERROR: application of sizeof to pointer
Using the real size to fix it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
---
drivers/power/supply/cw2015_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index 0c87ad0dbf71..db56db322b64 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;
--
2.30.2
Powered by blists - more mailing lists