* [PATCH 3/5] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code
@ 2011-07-04 14:11 Julia Lawall
2011-07-05 17:51 ` Kevin Hilman
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2011-07-04 14:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Julia Lawall <julia@diku.dk>
At this point, the ioremap has taken place, so the error handling code at
the label err_iounmap should be used rather than returning directly.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier x;
@@
kfree(x)
@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@
(
if (<+...x...+>) S
|
if (...) { ... when != kfree(x)
when != if (...) { ... kfree(x); ... }
when != x = E3
* return E1;
}
... when != x = E2
if (...) { ... when != x = E4
kfree(x); ... return ...; }
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
arch/arm/mach-omap2/smartreflex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index fb7dc52..e8280df 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -891,7 +891,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
ret = sr_late_init(sr_info);
if (ret) {
pr_warning("%s: Error in SR late init\n", __func__);
- return ret;
+ goto err_iounmap;
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/5] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code
2011-07-04 14:11 [PATCH 3/5] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code Julia Lawall
@ 2011-07-05 17:51 ` Kevin Hilman
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2011-07-05 17:51 UTC (permalink / raw)
To: linux-arm-kernel
Julia Lawall <julia@diku.dk> writes:
> From: Julia Lawall <julia@diku.dk>
>
> At this point, the ioremap has taken place, so the error handling code at
> the label err_iounmap should be used rather than returning directly.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> identifier x;
> @@
>
> kfree(x)
>
> @@
> identifier r.x;
> expression E1!=0,E2,E3,E4;
> statement S;
> @@
>
> (
> if (<+...x...+>) S
> |
> if (...) { ... when != kfree(x)
> when != if (...) { ... kfree(x); ... }
> when != x = E3
> * return E1;
> }
> ... when != x = E2
> if (...) { ... when != x = E4
> kfree(x); ... return ...; }
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Kevin Hilman <khilman@ti.com>
Tony, can you add this to devel-fixes?
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-05 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04 14:11 [PATCH 3/5] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code Julia Lawall
2011-07-05 17:51 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).