Messages in this thread Patch in this message | | | From | davidcomponentone@gmail ... | Subject | [PATCH] pyh: qcom: fix the application of sizeof to pointer | Date | Fri, 10 Dec 2021 14:21:19 +0800 |
| |
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
| |