From: Kevin Hilman Date: Tue, 05 Jul 2011 17:51:13 +0000 Subject: Re: [PATCH 3/5] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code Message-Id: <87tyb0sjji.fsf@ti.com> List-Id: References: <1309788705-22278-3-git-send-email-julia@diku.dk> In-Reply-To: <1309788705-22278-3-git-send-email-julia@diku.dk> (Julia Lawall's message of "Mon, 4 Jul 2011 16:11:43 +0200") MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org Julia Lawall writes: > From: Julia Lawall > > 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/) > > // > @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 ...; } > ) > // > > Signed-off-by: Julia Lawall Acked-by: Kevin Hilman Tony, can you add this to devel-fixes? Kevin