sound/soc/kirkwood/kirkwood-i2s.c: add missing kfree
Subsystems (3)
PATCH 1/4 sound/soc/kirkwood/kirkwood-i2s.c: add missing kfree
From: Julia Lawall <[email protected]>
Adjust the goto to jump to the error handling code that includes kfree.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@
(
if (...) { ... when != kfree(x)
when != x = E3
when != E3 = x
* return ...;
}
... when != x = E2
when != I(...,x,...) Sif (...) { ... when != x = E4
kfree(x); ... return ...; }
)
// </smpl>
--- sound/soc/kirkwood/kirkwood-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/kirkwood/kirkwood-i2s.c +1 -1
@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)if (!priv->mem) {dev_err (&pdev->dev,"request_mem_region failed\n" ); err = -EBUSY ; - goto error; + goto error_alloc; } priv->io =ioremap (priv->mem->start,SZ_16K );
Quoted 40 lines · Julia Lawall
From: Julia Lawall <[email protected]>
Adjust the goto to jump to the error handling code that includes kfree.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@(
if (...) { ... when != kfree(x)when != x = E3 when != E3 = x * return ...; } ... when != x = E2 when != I(...,x,...) Sif (...) { ... when != x = E4
kfree(x); ... return ...; }
)
// </smpl>Signed-off-by Julia Lawall <[email protected]>--- sound/soc/kirkwood/kirkwood-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/soc/kirkwood/kirkwood-i2s.c +0
-0
sound/soc/kirkwood/kirkwood-i2s.c static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev) · line 430
Quoted 8 lines
sound/soc/kirkwood/kirkwood-i2s.c +1
-1@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)if (!priv->mem) {dev_err (&pdev->dev,"request_mem_region failed\n" ); err = -EBUSY ; - goto error; + goto error_alloc; } priv->io =ioremap (priv->mem->start,SZ_16K );
All
Mark Brown
AppliedQuoted 6 lines · Julia Lawall
From: Julia Lawall <[email protected]>
Adjust the goto to jump to the error handling code that includes kfree.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
Applied, thanks.
PATCH 1/1 sound/soc/kirkwood/kirkwood-i2s.c: fix trivial build regression
In reply to Julia LawallA fix merged in 3.1-rc2 introduced a small regression, this should get it to build again.
---
Quoted 4 lines · On Saturday 20 August 2011 08:12:38 Julia Lawall wrote:
From: Julia Lawall <[email protected]>
Adjust the goto to jump to the error handling code that includes kfree.
/home/arnd/linux-arm/sound/soc/kirkwood/kirkwood-i2s.c: In function 'kirkwood_i2s_dev_probe':/home/arnd/linux-arm/sound/soc/kirkwood/kirkwood-i2s.c:427:3: error: label 'error_alloc' used but not defined
sound/soc/kirkwood/kirkwood-i2s.c +1 -1
@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)if (!priv->mem) {dev_err (&pdev->dev,"request_mem_region failed\n" ); err = -EBUSY ; - goto error_alloc; + goto err_alloc; } priv->io =ioremap (priv->mem->start,SZ_16K );
Re: [PATCH] sound/soc/kirkwood/kirkwood-i2s.c: fix trivial build regression
Quoted 30 lines · Arnd Bergmann
A fix merged in 3.1-rc2 introduced a small regression, this should get it to build again.
Signed-off-by Arnd Bergmann <[email protected]>---
Quoted 4 lines · On Saturday 20 August 2011 08:12:38 Julia Lawall wrote:
From: Julia Lawall <[email protected]>
Adjust the goto to jump to the error handling code that includes kfree.
/home/arnd/linux-arm/sound/soc/kirkwood/kirkwood-i2s.c: In function 'kirkwood_i2s_dev_probe':/home/arnd/linux-arm/sound/soc/kirkwood/kirkwood-i2s.c:427:3: error: label 'error_alloc' used but not definedsound/soc/kirkwood/kirkwood-i2s.c +1
-1@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)if (!priv->mem) {dev_err (&pdev->dev,"request_mem_region failed\n" ); err = -EBUSY ; - goto error_alloc; + goto err_alloc; }
Quoted 2 lines
priv->io = ioremap(priv->mem->start, SZ_16K);
Mark Brown
AppliedRe: [PATCH] sound/soc/kirkwood/kirkwood-i2s.c: fix trivial build regression
In reply to Arnd BergmannQuoted 4 lines · Arnd Bergmann
A fix merged in 3.1-rc2 introduced a small regression, this should get it to build again.
Signed-off-by Arnd Bergmann <[email protected]>
Applied, thanks.
Please try to make sure that your commit logs match the style of the subsystem.