pyh: qcom: fix the application of sizeof to pointer
Subsystems (2)
PATCH 1/1 pyh: qcom: fix the application of sizeof to pointer
From: David Yang <[email protected]>
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 <[email protected]>
Signed-off-by Yang Guang <[email protected]>
Signed-off-by David Yang <[email protected]>
--- drivers/phy/qualcomm/phy-qcom-edp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-edp.c +1 -1
@@ -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 ;
Signature · 1 line
2.30.2
Quoted 8 lines · On Tue 07 Dec 17:03 PST 2021, [email protected] wrote:
From: David Yang <[email protected]>
The coccinelle check report:
./drivers/phy/qualcomm/phy-qcom-edp.c:574:31-37:
ERROR: application of sizeof to pointerUsing the real size to fix it.
Thanks for the fix David.
Please see my answer here
https://lore.kernel.org/all/Ya96KOynsO478cVx@ripper/
Regards,
Bjorn
Quoted 23 lines
Reported-by Zeal Robot <[email protected]>Signed-off-by Yang Guang <[email protected]>Signed-off-by David Yang <[email protected]>--- drivers/phy/qualcomm/phy-qcom-edp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/phy/qualcomm/phy-qcom-edp.c +1
-1@@ -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 ;Signature · 1 line
2.30.2