From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754521Ab2A0AhK (ORCPT ); Thu, 26 Jan 2012 19:37:10 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:62246 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087Ab2A0AhI (ORCPT ); Thu, 26 Jan 2012 19:37:08 -0500 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX180f010rtrLx7ZYsweDUYby Date: Thu, 26 Jan 2012 16:37:05 -0800 From: Tony Lindgren To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 15/15] arch/arm/mach-omap2/smartreflex.c: add missing iounmap Message-ID: <20120127003704.GH29812@atomide.com> References: <1326362117-29371-15-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1326362117-29371-15-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Julia Lawall [120112 01:23]: > From: Julia Lawall > > Add missing iounmap in error handling code, in a case where the function > already preforms iounmap on some other execution path. Thanks I'll apply this into omap fixes branch. Regards, Tony > A simplified version of the semantic match that finds this problem is as > follows: (http://coccinelle.lip6.fr/) > > // > @@ > expression e; > statement S,S1; > int ret; > @@ > e = \(ioremap\|ioremap_nocache\)(...) > ... when != iounmap(e) > if (<+...e...+>) S > ... when any > when != iounmap(e) > *if (...) > { ... when != iounmap(e) > return ...; } > ... when any > iounmap(e); > // > > Signed-off-by: Julia Lawall > > --- > 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 9dd9345..7e755bb 100644 > --- a/arch/arm/mach-omap2/smartreflex.c > +++ b/arch/arm/mach-omap2/smartreflex.c > @@ -897,7 +897,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; > } > } > >