Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp383896iog; Wed, 15 Jun 2022 04:24:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRrYgAV4FfTgvx9zjhMVPvifOoe3NEG0tWAHL9EGXHpJcOhH1YNMu04yaMg60jOaxGyX9u X-Received: by 2002:a17:906:8302:b0:70d:7465:495a with SMTP id j2-20020a170906830200b0070d7465495amr8560079ejx.115.1655292251332; Wed, 15 Jun 2022 04:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655292251; cv=none; d=google.com; s=arc-20160816; b=dCb8Z4cca/DwCWDgYfm7MUL7ltMj4Qnim8GwCqK1KVIBNZvMWchJC+SECdL7l/cQ8r a5rlDNIOozY59fseVe9tmP4HRuAVW9oThSdLABbSFoDirJPydGB0agl+NuqPIPGIS2F7 Jxw6eN3nJTVAnDubz6kzcuje+kKYW9L5SoBLBFj3cdW4mxEs7T+eLsjCkod40pPsCX0a VSk9in6HsnwPjB3wo1DgdSE6gGMZ04UUHreVHmwCo8C/hd7x3KtzfOFXU0FIQqcJapd3 GTAzMJR0usaXmdUS051KoidvYnNfr8YAY66n2HZlVsdpaYON/bFOZllq8VCDZd00umaz s1qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=agISyymsHhjWmuGlNVKhM4TMuDfl2uTdWP2bEDeVALM=; b=g+SCtdT/XIkGwcPo2KU5CDx9CWFMd+R/cAicpL8aRlfOYVtkA7MJfZwPBRJ8kRlmVg 4TE2h9unaCOhaFSMumiWTRorDwvoEDA0PhW6qpD8d7ghSOh9kAqEB5MF5aXmTNQGGEd5 /EZYbPRaAQiDcqTDDUKdhbgoG/hoCkSD5GT7gU4aTr+7/8kUfVR2GiSBrf51iDdOxKT0 Rp+3a+pFttB8jrg/M2ja9NDnrOufgGP2cNy3iFLvTwBD87ARgqcyAxB6Md3uaW9ng4Oh 4SRpVBm/Umss6Nl5UsbsjUI/lSpq8iTC3s4qs+8Ro2GHSkVhCRU27oSGMYEacn/4my5S fdTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a1709064c4900b0070bf8e73c8dsi13017936ejw.374.2022.06.15.04.23.45; Wed, 15 Jun 2022 04:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240403AbiFOKfk (ORCPT + 99 others); Wed, 15 Jun 2022 06:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236849AbiFOKfh (ORCPT ); Wed, 15 Jun 2022 06:35:37 -0400 Received: from mail.bugwerft.de (mail.bugwerft.de [46.23.86.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCD384EF77 for ; Wed, 15 Jun 2022 03:35:36 -0700 (PDT) Received: from [10.10.0.82] (unknown [194.162.236.226]) by mail.bugwerft.de (Postfix) with ESMTPSA id B34E6282FB6; Wed, 15 Jun 2022 10:35:05 +0000 (UTC) Message-ID: <2ab4dcea-b365-cb1c-7ab4-67c9e39df83b@zonque.org> Date: Wed, 15 Jun 2022 12:35:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] [Re-PATCH] arch: arm: mach-pxa: Add missing of_node_put in irq.c Content-Language: en-US To: heliang , haojian.zhuang@gmail.com, robert.jarzmik@free.fr, linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220615103332.3963303-1-windhl@126.com> From: Daniel Mack In-Reply-To: <20220615103332.3963303-1-windhl@126.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/22 12:33, heliang wrote: > In pxa_dt_irq_init(), of_find_matching_node() will return a node > pointer with refcount incremented. We should use of_node_put in > fail path or when it is not used anymore. This goto-label patch > style is advised by Daniel. > > Signed-off-by: heliang Thanks for your patch! Acked-by: Daniel Mack > --- > arch/arm/mach-pxa/irq.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index 96f33ef1d9ea..338356b9f37c 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -247,13 +247,13 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) > &pxa_internal_irq_nr); > if (ret) { > pr_err("Not found marvell,intc-nr-irqs property\n"); > - return; > + goto out_put; > } > > ret = of_address_to_resource(node, 0, &res); > if (ret < 0) { > pr_err("No registers defined for node\n"); > - return; > + goto out_put; > } > pxa_irq_base = io_p2v(res.start); > > @@ -263,9 +263,12 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)) > ret = irq_alloc_descs(-1, 0, pxa_internal_irq_nr, 0); > if (ret < 0) { > pr_err("Failed to allocate IRQ numbers\n"); > - return; > + goto out_put; > } > > pxa_init_irq_common(node, pxa_internal_irq_nr, fn); > + > +out_put: > + of_node_put(node); > } > #endif /* CONFIG_OF */