From nobody Mon Apr 27 08:42:57 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 472EFC433EF for ; Wed, 15 Jun 2022 10:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348874AbiFOKe3 (ORCPT ); Wed, 15 Jun 2022 06:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348791AbiFOKeN (ORCPT ); Wed, 15 Jun 2022 06:34:13 -0400 Received: from m15111.mail.126.com (m15111.mail.126.com [220.181.15.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EDD852B22 for ; Wed, 15 Jun 2022 03:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=/8K3T 5y+ohmn9H6J0pjAY51Fti4HVcDrKSSJgq06u3Y=; b=bEJfMzH8xP1jIn1p35gyJ /pOpT5kOnArp3StGdlM3zNzbByqnMNTdS0oJIVkjUQRFcxR1qVi7q1+eOl8jM171 pTqyjQpC3kzIQMtLXv4N25dM+LD0SmbCANBlo/o9x3V6H6vCJ4hKpf2BSNANy6Jt j8uTvrpKYOnXfNzZO4gqG0= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp1 (Coremail) with SMTP id C8mowAD31d58tali3pekEQ--.56629S2; Wed, 15 Jun 2022 18:33:33 +0800 (CST) From: heliang To: daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, windhl@126.com Subject: [PATCH] [Re-PATCH] arch: arm: mach-pxa: Add missing of_node_put in irq.c Date: Wed, 15 Jun 2022 18:33:32 +0800 Message-Id: <20220615103332.3963303-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: C8mowAD31d58tali3pekEQ--.56629S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7CF45XFW5WFWDuw4rZryUAwb_yoW8Jw1xpr Wj9340yr18ur40gayjyay8ZrWYyF4vgF4jkayrC3W7Jw4rA3yjva10k3s3Z3WrKFW8Xa95 AF1Fya48uF95CaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0p_ucMdUUUUU= X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbiuB4hF2JVj35vHgAAsn Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 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; } =20 ret =3D 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 =3D io_p2v(res.start); =20 @@ -263,9 +263,12 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data = *, unsigned int)) ret =3D 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; } =20 pxa_init_irq_common(node, pxa_internal_irq_nr, fn); +=09 +out_put: + of_node_put(node);=09 } #endif /* CONFIG_OF */ --=20 2.25.1