From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH] arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Kumar Gala In-Reply-To: <1283111238-3129-1-git-send-email-julia@diku.dk> Date: Tue, 31 Aug 2010 16:39:11 -0500 Message-Id: References: <1283111238-3129-1-git-send-email-julia@diku.dk> To: Julia Lawall Cc: devicetree-discuss@lists.ozlabs.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Aug 29, 2010, at 2:47 PM, Julia Lawall wrote: > The function of_iomap returns the result of calling ioremap, so iounmap > should be called on the result in the error handling code, as done in the > normal exit of the function. > > The sematic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @r exists@ > local idexpression x; > expression E,E1; > identifier l; > statement S; > @@ > > *x = of_iomap(...); > ... when != iounmap(x) > when != if (...) { ... iounmap(x); ... } > when != E = x > when any > ( > if (x == NULL) S > | > if (...) { > ... when != iounmap(x) > when != if (...) { ... iounmap(x); ... } > ( > return <+...x...+>; > | > * return ...; > ) > } > ) > ... when != x = E1 > when any > iounmap(x); > // > > Signed-off-by: Julia Lawall > > --- > arch/powerpc/platforms/83xx/mpc837x_mds.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) applied to merge - k