public inbox for linux-phy@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] pyh: qcom: fix the application of sizeof to pointer
@ 2021-12-08  1:03 davidcomponentone
  2021-12-08  5:16 ` Bjorn Andersson
  0 siblings, 1 reply; 5+ messages in thread
From: davidcomponentone @ 2021-12-08  1:03 UTC (permalink / raw)
  To: agross
  Cc: davidcomponentone, bjorn.andersson, kishon, vkoul, linux-arm-msm,
	linux-phy, linux-kernel, Zeal Robot, Yang Guang

From: David Yang <davidcomponentone@gmail.com>

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@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
---
 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..5fe4eab9cac1 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, sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;
 
-- 
2.30.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] pyh: qcom: fix the application of sizeof to pointer
@ 2021-12-10  6:21 davidcomponentone
  2021-12-14  9:26 ` Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: davidcomponentone @ 2021-12-10  6:21 UTC (permalink / raw)
  To: agross
  Cc: bjorn.andersson, davidcomponentone, kishon, vkoul, linux-arm-msm,
	linux-phy, linux-kernel, Yang Guang, Zeal Robot

From: Yang Guang <yang.guang5@zte.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@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Yang Guang <yang.guang5@zte.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


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-14 10:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08  1:03 [PATCH] pyh: qcom: fix the application of sizeof to pointer davidcomponentone
2021-12-08  5:16 ` Bjorn Andersson
  -- strict thread matches above, loose matches on Subject: below --
2021-12-10  6:21 davidcomponentone
2021-12-14  9:26 ` Vinod Koul
2021-12-14 10:17   ` David Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox