From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Pihet Subject: [PATCH 02/21] arch/arm/mach-omap2/smartreflex.c: add missing error-handling code Date: Wed, 25 Jan 2012 16:16:04 +0100 Message-ID: <1327504583-13408-3-git-send-email-j-pihet@ti.com> References: <1327504583-13408-1-git-send-email-j-pihet@ti.com> Mime-Version: 1.0 Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:34423 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752858Ab2AYPQp (ORCPT ); Wed, 25 Jan 2012 10:16:45 -0500 Received: by wgbed3 with SMTP id ed3so5390421wgb.1 for ; Wed, 25 Jan 2012 07:16:44 -0800 (PST) In-Reply-To: <1327504583-13408-1-git-send-email-j-pihet@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, balbi@ti.com, nm@ti.com Cc: Kevin Hilman , Paul Walmsley , Julia Lawall , Jean Pihet 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 Signed-off-by: Jean Pihet --- arch/arm/mach-omap2/smartreflex.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; } } -- 1.7.5.4