From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8712CC433EF for ; Thu, 16 Jun 2022 09:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I7doixX1loiVU1mg931IQ7bn/qKr0vAq6ivR265STuo=; b=h/2X99K9r01VRs 11AI+FjLZdnNbAiaFcjkzyN3UroBNToF4rWB2A30BbVBlwnK8KyQkw6NxBftcMuAmSNr2KfpbGRfp zzx6HvibbGikdFhIDL1k4S38f7NSeRpo4R1321GxWjjujPVl+gLrNpn/rWba6BeCDMnDQAw0CYcs4 ZM7KLKwLI6yq7pAOo5gNOxsZx6ZTZ78oS40h+N/MfbUVDf8VdYOGa+HXjkTxx8WzNDptM8ij47jNB o+Kg18VFwLNG2jprxGlM70RRq35KBvgSkIE5nH7rYFuySsysksj+bHdLYYmmehgXCaGHzehsee4Nh NGaWPR+2DeGSApE2MCpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1mAY-001lNB-PC; Thu, 16 Jun 2022 09:52:06 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1mAV-001lM6-4h for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 09:52:04 +0000 Received: by mail-pj1-x1032.google.com with SMTP id gd1so993547pjb.2 for ; Thu, 16 Jun 2022 02:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Pd3vKUxuz7Neq/KsDVniIvd+pYB4Tm3B3eTO5pzeGQU=; b=SlDq10xywGLpgTKhUH0vz5t7ob9J/Q3FoEn6Lu7EjDpni4O1kOmB4nX5w3WdaUUyh3 aoqxroMy9K/NM687xue8G45rCtWmGAuUpgD5q3WU6Gqf18cjQCH+jAlMFGQBCY3kFZOR DNe5Udq2r5+3GxFp/qj/D9JqEqITvcfM1QNgWvE6i3odZTDGHuJyS7LQWVNAXl46MxPT Do0fYf5iftTJROvVTe1ykm/uDxCM4pw4CyTXmBr+A5DwTq15vkrYQjgkoddlss2HpuCY xCg+vddXZi2zhDJX7Fo9fCBY3HHKiVwA8W144rOs+BCT7UZa5hvFeUnCDLd54YOY9+e+ TMxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Pd3vKUxuz7Neq/KsDVniIvd+pYB4Tm3B3eTO5pzeGQU=; b=uyH73gqkJ5niTKm0LxAlsKRF/JWWDIOSnNVU4NTLpHvoS2r4KEiMO6unX4fNSM1vcQ jevinXdj5fG6YTfZlYVvxBlgDs9QBwHkcGUg5mKdW6IC6wU/GutQ0xz59sjQvpMdhTe6 a8sQDF4NZOaZiUbYqocApN0+wHaRHfToEATBFtZSZTdlHkz3DC3WUliAWmXOSPbEDGPm fraKPkKARF3VGHdZ1CPnU/1irqZRyCzxM+N+xUgNWuW6akMIVbeEJ2fJj778uMpIKi2l ZgtbRFUJyPNS9DtwmFBtE7T5H4OuS3GRObeKl5Q5Fa/GF9W+einNLQC3Z2Zfr1UKjOqz ihfg== X-Gm-Message-State: AJIora8sVpUAukoHmXJPAxv+hpyjNRf0/NZyEGOvuyLsbB5H2JDSCbwW +xdioDExbFEEV7B6Po/ea0KClg== X-Google-Smtp-Source: AGRyM1uhUab8hspyAC4ENwVpVPnptGHEppx2G/Up3Tvw1+Ro/aUeS1M2CUAGVRLeVMLEvV73bMO7kA== X-Received: by 2002:a17:903:1c5:b0:167:71bd:462f with SMTP id e5-20020a17090301c500b0016771bd462fmr4034415plh.65.1655373119282; Thu, 16 Jun 2022 02:51:59 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id g17-20020a639f11000000b004085adf1372sm1250564pge.77.2022.06.16.02.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 02:51:58 -0700 (PDT) Date: Thu, 16 Jun 2022 15:21:56 +0530 From: Viresh Kumar To: Liang He Cc: vireshk@kernel.org, shiraz.linux.kernel@gmail.com, soc@kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] arm: mach-spear: Add missing of_node_put() in time.c Message-ID: <20220616095156.clyiogsvrxbmyrd6@vireshk-i7> References: <20220616093027.3984903-1-windhl@126.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220616093027.3984903-1-windhl@126.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_025203_269759_2266ACD3 X-CRM114-Status: GOOD ( 17.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 16-06-22, 17:30, Liang He wrote: > In spear_setup_of_timer(), of_find_matching_node() will return a > node pointer with refcount incrementd. We should use of_node_put() > in each fail path or when it is not used anymore. > > Signed-off-by: Liang He > --- > changelog: > > v2: use goto-label patch style suggested by Viresh. > v1: use plain of_node_put in each fail path. > > arch/arm/mach-spear/time.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c > index d1fdb6066f7b..c7c17c0f936c 100644 > --- a/arch/arm/mach-spear/time.c > +++ b/arch/arm/mach-spear/time.c > @@ -218,13 +218,13 @@ void __init spear_setup_of_timer(void) > irq = irq_of_parse_and_map(np, 0); > if (!irq) { > pr_err("%s: No irq passed for timer via DT\n", __func__); > - return; > + goto err_put_np; > } > > gpt_base = of_iomap(np, 0); > if (!gpt_base) { > pr_err("%s: of iomap failed\n", __func__); > - return; > + goto err_put_np; > } > > gpt_clk = clk_get_sys("gpt0", NULL); > @@ -239,6 +239,8 @@ void __init spear_setup_of_timer(void) > goto err_prepare_enable_clk; > } > > + of_node_put(np); > + > spear_clockevent_init(irq); > spear_clocksource_init(); > > @@ -248,4 +250,6 @@ void __init spear_setup_of_timer(void) > clk_put(gpt_clk); > err_iomap: > iounmap(gpt_base); > +err_put_np: > + of_node_put(np); > } Acked-by: Viresh Kumar -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel