[PATCH -next] clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()

Subsystems: arm/amlogic meson soc clock framework, common clk framework, the rest

STALE3674d

3 messages, 3 authors, 2016-08-24 · open the first message on its own page

[PATCH -next] clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()

From: Wei Yongjun <hidden>
Date: 2016-08-22 16:08:21

From: Wei Yongjun <redacted>

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/clk/meson/gxbb-aoclk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/meson/gxbb-aoclk.c b/drivers/clk/meson/gxbb-aoclk.c
index 61ef28a..b45c5fb 100644
--- a/drivers/clk/meson/gxbb-aoclk.c
+++ b/drivers/clk/meson/gxbb-aoclk.c
@@ -142,7 +142,7 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct gxbb_aoclk_reset_controller *rstc;
 
-	rstc = devm_kzalloc(dev, sizeof(rstc), GFP_KERNEL);
+	rstc = devm_kzalloc(dev, sizeof(*rstc), GFP_KERNEL);
 	if (!rstc)
 		return -ENOMEM;
 

Re: [PATCH -next] clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()

From: Neil Armstrong <hidden>
Date: 2016-08-23 07:58:14

On 08/22/2016 06:08 PM, Wei Yongjun wrote:
quoted hunk
From: Wei Yongjun <redacted>

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/clk/meson/gxbb-aoclk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/meson/gxbb-aoclk.c b/drivers/clk/meson/gxbb-aoclk.c
index 61ef28a..b45c5fb 100644
--- a/drivers/clk/meson/gxbb-aoclk.c
+++ b/drivers/clk/meson/gxbb-aoclk.c
@@ -142,7 +142,7 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct gxbb_aoclk_reset_controller *rstc;
 
-	rstc = devm_kzalloc(dev, sizeof(rstc), GFP_KERNEL);
+	rstc = devm_kzalloc(dev, sizeof(*rstc), GFP_KERNEL);
 	if (!rstc)
 		return -ENOMEM;
 

Aww, my bad.

Acked-by: Neil Armstrong <redacted>

Also :
Fixes: f8c11f79912d ("clk: meson: Add GXBB AO Clock and Reset controller driver")

Re: [PATCH -next] clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()

From: Stephen Boyd <hidden>
Date: 2016-08-24 17:29:44

On 08/22, Wei Yongjun wrote:
From: Wei Yongjun <redacted>

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <redacted>
---
Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help