From patchwork Sat May 13 11:40:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9725155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29D11601E7 for ; Sat, 13 May 2017 11:40:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 176AA288C6 for ; Sat, 13 May 2017 11:40:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C03D288E0; Sat, 13 May 2017 11:40:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BEBEC288C6 for ; Sat, 13 May 2017 11:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=H6XUmuLwuv0d2OH9V2VIoGqIdi3ieHqZKWH6HIf1WwI=; b=bls lVo1W34/QQg0BQ2BN2aYafCSqGZPe4kvXNH3tzNwVOHJLHMM4inAjtFXMGiRzUZtxWCrFVk47DgRn /3u5AD5/vCjExPqU7UGSG6wrgDv+CccCqJi3/Eoms66mibHV6y9yA5MiSm5kQonNj/7rYF/R28mQH W1lFq1eLLAtdS6itwHcRMa1KQ1OMHaFKVCK5mUyiv6p7mf/d3GuhuEsWUaCCkvwOYuUlr3DSOCEvl GRuq68kOquikJpmvuULjCdAEG32/zm3Kfn7cmATmcTF4ksSBi9bFvNxx/5h4a7jy09OLjtNtCdMqB f2kHI3ZaIKYMkIupE5TwaQICTh7bTtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d9VPt-00037N-66; Sat, 13 May 2017 11:40:57 +0000 Received: from smtp01.smtpout.orange.fr ([80.12.242.123] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d9VPe-0002oZ-LY for linux-arm-kernel@lists.infradead.org; Sat, 13 May 2017 11:40:44 +0000 Received: from localhost.localdomain ([92.140.175.66]) by mwinf5d36 with ME id KngQ1v00A1SKe3803ngQBE; Sat, 13 May 2017 13:40:24 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 13 May 2017 13:40:24 +0200 X-ME-IP: 92.140.175.66 From: Christophe JAILLET To: nsekhar@ti.com, khilman@kernel.org, linux@armlinux.org.uk Subject: [PATCH 2/2] ARM: davinci: PM: Do not free useful resources in normal path in 'davinci_pm_init' Date: Sat, 13 May 2017 13:40:20 +0200 Message-Id: <20170513114020.23668-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170513_044043_110150_7087D479 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This looks spurious to iounmap resources in the normal path of this init function. The 3 ioremap'ed fields of 'pm_config' can be accessed later on in other functions, so it is likely that we should return 'success' before unrolling everything. Fixes: aa9aa1ec2df6 ("ARM: davinci: PM: rework init, remove platform device") Signed-off-by: Christophe JAILLET --- This patch is just a *guess*. The end of the function looks more like a error handling code rather than a normal path. --- arch/arm/mach-davinci/pm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index d282b0783ecf..163d865abbf9 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c @@ -161,6 +161,7 @@ int __init davinci_pm_init(void) davinci_cpu_suspend_sz); suspend_set_ops(&davinci_pm_ops); + return 0; no_sram_mem: iounmap(pm_config.ddrpsc_reg_base);