Skip to contentSkip to conversation

sh-pfc: sh_pfc_probe() sizeof() fix

PATCH In review Magnus Damm 4 participants 8 messages Feb 14, 2013 – Feb 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh-pfc: sh_pfc_probe() sizeof() fix

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

---

Written against -next in renesas.git

 drivers/pinctrl/sh-pfc/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/core.c +1 -1
@@ -495,7 +495,7 @@ static int sh_pfc_probe(struct platform_
 	if (info = NULL)
 		return -ENODEV;
 
-	pfc = devm_kzalloc(&pdev->dev, sizeof(pfc), GFP_KERNEL);
+	pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL);
 	if (pfc = NULL)
 		return -ENOMEM;
 
#1 lore raw

Hi Magnus,

Thanks for the patch.

Quoted 4 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Oops :-)

This is v3.9 material. Simon, could you please take this and push it upstream for v3.9 ?

Quoted 18 lines

---

Written against -next in renesas.git

 drivers/pinctrl/sh-pfc/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/core.c +1 -1
@@ -495,7 +495,7 @@ static int sh_pfc_probe(struct platform_
 	if (info = NULL)
 		return -ENODEV;
 
-	pfc = devm_kzalloc(&pdev->dev, sizeof(pfc), GFP_KERNEL);
+	pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL);
 	if (pfc = NULL)
 		return -ENOMEM;
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
In reply to Magnus Damm

Hi Laurent,

Quoted 11 lines · Laurent Pinchart

Hi Magnus,

Thanks for the patch.

Quoted 4 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Oops :-)

=)

Quoted 2 lines

This is v3.9 material. Simon, could you please take this and push it upstream for v3.9 ?

Yes, that would be great!

/ magnus

Acked-by on v1 1/1
#3 lore raw
In reply to Magnus Damm
Quoted 6 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Forgot to add my

Quoted 17 lines

---

Written against -next in renesas.git

 drivers/pinctrl/sh-pfc/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/core.c +1 -1
@@ -495,7 +495,7 @@ static int sh_pfc_probe(struct platform_
 	if (info = NULL)
 		return -ENODEV;
 
-	pfc = devm_kzalloc(&pdev->dev, sizeof(pfc), GFP_KERNEL);
+	pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL);
 	if (pfc = NULL)
 		return -ENOMEM;
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw
In reply to Magnus Damm
Quoted 7 lines · Laurent Pinchart

Hi Magnus,

Thanks for the patch.

Quoted 2 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Quoted 7 lines
Quoted 2 lines

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Oops :-)

This is v3.9 material. Simon, could you please take this and push it upstream for v3.9 ?

Sure, will do.

#5 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 11 lines · Simon Horman
Quoted 10 lines · Laurent Pinchart

Hi Magnus,

Thanks for the patch.

Quoted 4 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Quoted 6 lines
Quoted 4 lines

Oops :-)

This is v3.9 material. Simon, could you please take this and push it upstream for v3.9 ?

Sure, will do.

Thanks.

/ magnus

#7 lore raw
In reply to Magnus Damm
Quoted 11 lines · Laurent Pinchart
Quoted 6 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Forgot to add my

[snip]

Quoted 10 lines · Linus Walleij
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix sizeof() usage in sh-pfc/core.c to allocate space for the full data structure instead of a pointer.

Thanks. I have added the Acked-by lines and sent a pull-request to arm-soc to have it included in 3.9.