From nobody Wed Apr 1 21:14:35 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 82EA3C433EF for ; Thu, 16 Jun 2022 15:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377570AbiFPP0B (ORCPT ); Thu, 16 Jun 2022 11:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233439AbiFPPZ7 (ORCPT ); Thu, 16 Jun 2022 11:25:59 -0400 Received: from m15113.mail.126.com (m15113.mail.126.com [220.181.15.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 49A382E09A for ; Thu, 16 Jun 2022 08:25:57 -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=coaM8 pDPv4WD3NukZ62DQq1/+jhgGiORkl6++lYLC+A=; b=kvNLnPsMxg6w8VfQG0Wni R87cgA0/bdv8rT0HQXa/n0U1QbNMuiWptvIOh/a90GyuDzV+IP6Mvn4LxHxTLqX2 freGqkMMMfTX/ezKoQMT7SU9b6R+Y3EvGGy7756Imrw2BNcDmF8hr+GJxMnTRvHL ftDozWBOy7m74trbS7M/+0= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp3 (Coremail) with SMTP id DcmowADXc5VSS6tizrX+DQ--.15781S2; Thu, 16 Jun 2022 23:25:06 +0800 (CST) From: Liang He To: linux@armlinux.org.uk, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com Cc: windhl@126.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm: mach-imx: Fix refcount leak in mm-imx3.c Date: Thu, 16 Jun 2022 23:25:05 +0800 Message-Id: <20220616152505.3989451-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: DcmowADXc5VSS6tizrX+DQ--.15781S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtF4UXry8JryrKry3Kry7trb_yoWktrc_Xa 9agwnrtr4rCF4kur4DZw4fWay2yws5uF15Jr1jv3ZrtwsxZF17ArsFyF9Fqa45Gr429rW5 ArWDZa15A342kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjnYwUUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbizhMiF18RPTmfQgAAs- Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In imx31_init_early() and imx35_init_early(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He --- changelog: v2: add missing put for both imx31_xx and imx35_xx v1: only add missing put in imx31_xx arch/arm/mach-imx/mm-imx3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 28db97289ee8..d333a8fdb731 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c @@ -107,6 +107,7 @@ void __init imx31_init_early(void) arm_pm_idle =3D imx31_idle; np =3D of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm"); mx3_ccm_base =3D of_iomap(np, 0); + of_node_put(np); BUG_ON(!mx3_ccm_base); } #endif /* ifdef CONFIG_SOC_IMX31 */ @@ -144,6 +145,7 @@ void __init imx35_init_early(void) arch_ioremap_caller =3D imx3_ioremap_caller; np =3D of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm"); mx3_ccm_base =3D of_iomap(np, 0); + of_node_put(np); BUG_ON(!mx3_ccm_base); } #endif /* ifdef CONFIG_SOC_IMX35 */ --=20 2.25.1