From patchwork Thu Mar 24 16:35:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Koskinen, Aaro (Nokia - FI/Espoo)" X-Patchwork-Id: 659191 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2OGcvNe012164 for ; Thu, 24 Mar 2011 16:38:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387Ab1CXQix (ORCPT ); Thu, 24 Mar 2011 12:38:53 -0400 Received: from smtp.nokia.com ([147.243.128.26]:29113 "EHLO mgw-da02.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959Ab1CXQiw (ORCPT ); Thu, 24 Mar 2011 12:38:52 -0400 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da02.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p2OGclSA007507; Thu, 24 Mar 2011 18:38:47 +0200 Received: from localhost.localdomain ([helruo-dhcp02150.ntc.nokia.com [172.21.21.50]]) by mgw-da02.nokia.com with RELAY id p2OGc6Qj006960 ; Thu, 24 Mar 2011 18:38:23 +0200 From: Aaro Koskinen To: tony@atomide.com, khilman@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Aaro Koskinen Subject: [PATCH 4/6] arm: mach-omap2: smartreflex: fix ioremap leak on probe error Date: Thu, 24 Mar 2011 18:35:33 +0200 Message-Id: <1300984535-10530-4-git-send-email-aaro.koskinen@nokia.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1300984535-10530-1-git-send-email-aaro.koskinen@nokia.com> References: <1300984535-10530-1-git-send-email-aaro.koskinen@nokia.com> X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 24 Mar 2011 16:38:57 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 81bd5ed..e72b419 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -904,7 +904,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); if (!vdd_dbg_dir) { ret = -EINVAL; - goto err_release_region; + goto err_iounmap; } sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); @@ -912,7 +912,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", __func__); ret = PTR_ERR(sr_info->dbg_dir); - goto err_release_region; + goto err_iounmap; } (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, @@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s: Unable to create debugfs directory" "for n-values\n", __func__); ret = PTR_ERR(nvalue_dir); - goto err_release_region; + goto err_iounmap; } omap_voltage_get_volttable(sr_info->voltdm, &volt_data); @@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) "entries for n-values\n", __func__, sr_info->voltdm->name); ret = -ENODATA; - goto err_release_region; + goto err_iounmap; } for (i = 0; i < sr_info->nvalue_count; i++) { @@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev) return ret; +err_iounmap: + iounmap(sr_info->base); err_release_region: release_mem_region(mem->start, resource_size(mem)); err_free_devinfo: