From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755207AbdEMNWc (ORCPT ); Sat, 13 May 2017 09:22:32 -0400 Received: from mx02-sz.bfs.de ([194.94.69.103]:31189 "EHLO mx02-sz.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbdEMNWa (ORCPT ); Sat, 13 May 2017 09:22:30 -0400 Message-ID: <59170891.4010307@bfs.de> Date: Sat, 13 May 2017 15:22:25 +0200 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Christophe JAILLET CC: nsekhar@ti.com, khilman@kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2] ARM: davinci: PM: Do not free useful resources in normal path in 'davinci_pm_init' References: <20170513114020.23668-1-christophe.jaillet@wanadoo.fr> In-Reply-To: <20170513114020.23668-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 13.05.2017 13:40, schrieb Christophe JAILLET: > 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); looks like, but that would mean that is wrong also: davinci_sram_suspend = sram_alloc(davinci_cpu_suspend_sz, NULL); if (!davinci_sram_suspend) { pr_err("PM: cannot allocate SRAM memory\n"); return -ENOMEM; } what means 1 iounmap missing. re, wh