diff mbox series

pyh: qcom: fix the application of sizeof to pointer

Message ID 8d75af8e322a7e5839d2dd4320b696ee09ec0843.1639100549.git.yang.guang5@zte.com.cn (mailing list archive)
State Not Applicable
Headers show
Series pyh: qcom: fix the application of sizeof to pointer | expand

Commit Message

David Yang Dec. 10, 2021, 6:21 a.m. UTC
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(-)

Comments

Vinod Koul Dec. 14, 2021, 9:26 a.m. UTC | #1
On 10-12-21, 14:21, davidcomponentone@gmail.com wrote:
> 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

- this should be tagged v2
- You should always note the changes done in v2 (after the --- line)
- subsystem name is 'phy' and not pyh
- I have already applied fix e87f13c33e126ab2c72f9acb5ae98fbb93ddfd32
David Yang Dec. 14, 2021, 10:17 a.m. UTC | #2
Sorry about that. Thank you for your advice.

On Tue, Dec 14, 2021 at 02:56:35PM +0530, Vinod Koul wrote:
> On 10-12-21, 14:21, davidcomponentone@gmail.com wrote:
> > 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
> 
> - this should be tagged v2
> - You should always note the changes done in v2 (after the --- line)
> - subsystem name is 'phy' and not pyh
> - I have already applied fix e87f13c33e126ab2c72f9acb5ae98fbb93ddfd32
> 
> -- 
> ~Vinod
diff mbox series

Patch

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;