From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbcHPNFl (ORCPT ); Tue, 16 Aug 2016 09:05:41 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35411 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753494AbcHPNFZ (ORCPT ); Tue, 16 Aug 2016 09:05:25 -0400 Subject: Re: [v.1] clocksource:clps711x-timer:- Unmap a region obtained by remap To: Arvind Yadav , tglx@linutronix.de References: <1470937308-9480-1-git-send-email-arvind.yadav.cs@gmail.com> Cc: shc_work@mail.ru, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Daniel Lezcano Message-ID: <57B30F68.4080701@linaro.org> Date: Tue, 16 Aug 2016 15:04:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1470937308-9480-1-git-send-email-arvind.yadav.cs@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arvind, On 08/11/2016 07:41 PM, Arvind Yadav wrote: > iounmap frees the mapping when timer id is not matching. > > Signed-off-by: Arvind Yadav > --- Even if this fix is correct, it does actually rollback a minimalist part of what was done and only if the clock type is wrong. Can you properly handle the undo from the different init functions and regarding their success/error ? Thanks. -- Daniel > drivers/clocksource/clps711x-timer.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c > index 84aed78..deaca51 100644 > --- a/drivers/clocksource/clps711x-timer.c > +++ b/drivers/clocksource/clps711x-timer.c > @@ -116,6 +116,7 @@ static int __init clps711x_timer_init(struct device_node *np) > case CLPS711X_CLKSRC_CLOCKEVENT: > return _clps711x_clkevt_init(clock, base, irq); > default: > + iounmap(base); > return -EINVAL; > } > } > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog