sh-pfc: sh_pfc_probe() sizeof() fix
Subsystems (2)
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 ;
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 insh-pfc/core.cto 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
Signed-off-by Magnus Damm <[email protected]>---
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
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 insh-pfc/core.cto 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
Quoted 6 lines · On Thursday 14 February 2013 21:23:47 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Fix
sizeof()usage insh-pfc/core.cto allocate space for the full data structure instead of a pointer.Signed-off-by Magnus Damm <[email protected]>
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
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 insh-pfc/core.cto 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.
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 insh-pfc/core.cto 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
Quoted 6 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Fix
sizeof()usage insh-pfc/core.cto allocate space for the full data structure instead of a pointer.Signed-off-by Magnus Damm <[email protected]>
Thanks!
Linus Walleij
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 insh-pfc/core.cto allocate space for the full data structure instead of a pointer.Signed-off-by Magnus Damm <[email protected]>Forgot to add my
Acked-by Laurent Pinchart <[email protected]>
[snip]
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Fix
sizeof()usage insh-pfc/core.cto allocate space for the full data structure instead of a pointer.Signed-off-by Magnus Damm <[email protected]>Acked-by Linus Walleij <[email protected]>
Thanks. I have added the Acked-by lines and sent a pull-request to arm-soc to have it included in 3.9.