clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()
PATCH 1/1 clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()
From: Wei Yongjun <[email protected]>
sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data.
--- drivers/clk/meson/gxbb-aoclk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/gxbb-aoclk.c +1 -1
@@ -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 ;
PATCH 1/1 clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()
Quoted 18 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
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 <[email protected]>--- drivers/clk/meson/gxbb-aoclk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/meson/gxbb-aoclk.c +0
-0
drivers/clk/meson/gxbb-aoclk.c static int gxbb_aoclkc_probe(struct platform_device *pdev) · line 148
Quoted 8 lines
drivers/clk/meson/gxbb-aoclk.c +1
-1@@ -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.
Also :
Stephen Boyd
AppliedPATCH 1/1 clk: meson: Fix invalid use of sizeof in gxbb_aoclkc_probe()
In reply to Wei YongjunQuoted 7 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
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 <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project