[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <8d75af8e322a7e5839d2dd4320b696ee09ec0843.1639100549.git.yang.guang5@zte.com.cn>
Date: Fri, 10 Dec 2021 14:21:19 +0800
From: davidcomponentone@...il.com
To: agross@...nel.org
Cc: bjorn.andersson@...aro.org, davidcomponentone@...il.com,
kishon@...com, vkoul@...nel.org, linux-arm-msm@...r.kernel.org,
linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org,
Yang Guang <yang.guang5@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] pyh: qcom: fix the application of sizeof to pointer
From: Yang Guang <yang.guang5@....com.cn>
The coccinelle check report:
./drivers/phy/qualcomm/phy-qcom-edp.c:574:31-37:
ERROR: application of sizeof to pointer
Using the real size to fix it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
drivers/phy/qualcomm/phy-qcom-edp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c
index 17d5653b661d..a8ecd2e8442d 100644
--- a/drivers/phy/qualcomm/phy-qcom-edp.c
+++ b/drivers/phy/qualcomm/phy-qcom-edp.c
@@ -571,7 +571,7 @@ static int qcom_edp_clks_register(struct qcom_edp *edp, struct device_node *np)
struct clk_init_data init = { };
int ret;
- data = devm_kzalloc(edp->dev, sizeof(data), GFP_KERNEL);
+ data = devm_kzalloc(edp->dev, struct_size(data, hws, 2), GFP_KERNEL);
if (!data)
return -ENOMEM;
--
2.30.2
Powered by blists - more mailing lists