Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1362401rwb; Thu, 8 Dec 2022 09:38:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7mFvFCi11A2oXh06zUIHHhQQbeCHZYWy2nTJgf3LBCziImnZ/I8U120m3T1aA3pqoKOn4L X-Received: by 2002:a17:906:29ca:b0:7c0:d0da:d9c8 with SMTP id y10-20020a17090629ca00b007c0d0dad9c8mr19125000eje.712.1670521133910; Thu, 08 Dec 2022 09:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670521133; cv=none; d=google.com; s=arc-20160816; b=GGSwx40Rp9S8nSmEXU0UHQaIiFgk43Z9GqhQ6VakXeT+WrDpLF3OATx6lFCJbCr8h7 77waM2RHrD0GQDQ/iZd7XTfXzEPC/vBLewuzP4c6UGKYsvQ86S03SgyLagI3TBiRwodh Wjl9p/Kv+IxMJ6k5TEXUJMIvQbTp0lePKnWEFka5Bz6wYB4//ypTW0+ogiGcVND/2gyU fg3HeCsP2FT7fMj9on2IGdgfY50ZDjEAl37vUSGosAEmlOfXtP9tn+COxcb6n9NSlNlN j/p2nJ3tcRoD0T4cUta4IroNAQEHRZx06hVjPOnp0/5i1pA6i+YX5qujjtPaW/sWjcZp hRfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lALHATX+hiDxRwsr9MpdMABICaz3d1AN8racNeFX2to=; b=vbhOr9jtQUXr+bRTdBJ2rSZhr9vULTEvQCh2w+GjmgIaiemNm03cMDlMmYAMK6X6C9 rloR+Oeu1V2lowDzSQ5lROGXOfdUzty7d8EjqYZ2KUf7+2YuInT6n5+pHvBX5U3AP466 t40wvqaKV9P2EgxvlJUJlGHgZl/2c+luBnE/BoPzVdyKW+FbpMDMvnejFbNLHRoLiIvB SjzH3Q7hiDxuChB5gyGmadDrOkzGmPY8v9RyTYvTBM4sfxEMybppOpmu+JEERk4+S6Oi c3Fb4s8KMZD6psN1VLtIdIfbZrhBUqZRPhNpvRWNSXr0AkDK9f45M8TPk42aQCCr54/P AYfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iiolJJcK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb13-20020a170907960d00b007c1052c9243si9368108ejc.15.2022.12.08.09.38.34; Thu, 08 Dec 2022 09:38:53 -0800 (PST) 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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iiolJJcK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230334AbiLHQyc (ORCPT + 72 others); Thu, 8 Dec 2022 11:54:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230339AbiLHQy0 (ORCPT ); Thu, 8 Dec 2022 11:54:26 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9833176801 for ; Thu, 8 Dec 2022 08:54:15 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id a16so2594740edb.9 for ; Thu, 08 Dec 2022 08:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lALHATX+hiDxRwsr9MpdMABICaz3d1AN8racNeFX2to=; b=iiolJJcKC+aSJva6tJ+DXK3Pcrwcjyc2A27NkGNQ/Pv2HMBnRRrcJzegf/sr7UnnfG Ee84SyF4XFxroIaOUjjZ0XStab7/YEg4S6e7/kYxFKsfthZi/CJA5J+7WA12VhIH8e9k 2g0T1MP8RP1ICq+z17RlQE2D1DLw2hYDzUF3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lALHATX+hiDxRwsr9MpdMABICaz3d1AN8racNeFX2to=; b=RH6bwLaatsT7aVb1VFxnfcfbniyHDzBRpfDz12P8xs9SklrKJhg3QHyqeVz9GUmJqr bVXyIMmOHgkEJaj+yD/DEBW52Qk53YyquTernG0LIWCvhTGA1yRgK08JUcGGEScW2K/H nvsB6ZwDhgQIM5y/KQSoe5wkXKfVGWy2rFVOJardZUwN3HLPoZN6ldmZyv8g0cnVTtZQ 0MNnTvwNnRS/YnLGvplmOtGelW2ccWiyP9eLc62Gq+PwFSEOtWmr+BwV3okYDe/w0jF6 lJb4oPYHaW+iu5ELRyX7QqkxCic40NUiS3yr9kr5ZhSuao1Cocm5GScc7n0rNqDzi0BE n6HQ== X-Gm-Message-State: ANoB5plaFYq7VchaPWlicH5/zmJPhQdSzsktDFr5wYGMTn+c3oPDwfi7 RUwkMuxQ7oQjYLsQzNAzpt0X5ksIVou9MZfH X-Received: by 2002:aa7:cc02:0:b0:45c:835c:1ecd with SMTP id q2-20020aa7cc02000000b0045c835c1ecdmr2549907edt.27.1670518454015; Thu, 08 Dec 2022 08:54:14 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-54-95-136.retail.telecomitalia.it. [82.54.95.136]) by smtp.gmail.com with ESMTPSA id n11-20020a170906118b00b007be696512ecsm9780614eja.187.2022.12.08.08.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 08:54:13 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , Dario Binacchi , Arnd Bergmann , Fabio Estevam , Martin Kaiser , NXP Linux Team , Pengutronix Kernel Team , Russell King , Sascha Hauer , Shawn Guo , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/1] ARM: imx: add missing of_node_put() Date: Thu, 8 Dec 2022 17:54:03 +0100 Message-Id: <20221208165404.1512014-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20221208165404.1512014-1-dario.binacchi@amarulasolutions.com> References: <20221208165404.1512014-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Calling of_find_compatible_node() returns a node pointer with refcount incremented. Use of_node_put() on it when done. The patch fixes the same problem on different i.MX platforms. Fixes: 8b88f7ef31dde ("ARM: mx25: Retrieve IIM base from dt") Fixes: 94b2bec1b0e05 ("ARM: imx27: Retrieve the SYSCTRL base address from devicetree") Fixes: 3172225d45bd9 ("ARM: imx31: Retrieve the IIM base address from devicetree") Fixes: f68ea682d1da7 ("ARM: imx35: Retrieve the IIM base address from devicetree") Fixes: ee18a7154ee08 ("ARM: imx5: retrieve iim base from device tree") Signed-off-by: Dario Binacchi --- Changes in v2: - Combine the 5 patches (one for each platform) into one patch as suggested by Arnd Bergmann. arch/arm/mach-imx/cpu-imx25.c | 1 + arch/arm/mach-imx/cpu-imx27.c | 1 + arch/arm/mach-imx/cpu-imx31.c | 1 + arch/arm/mach-imx/cpu-imx35.c | 1 + arch/arm/mach-imx/cpu-imx5.c | 1 + 5 files changed, 5 insertions(+) diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c index 3e63445cde06..cc86977d0a34 100644 --- a/arch/arm/mach-imx/cpu-imx25.c +++ b/arch/arm/mach-imx/cpu-imx25.c @@ -23,6 +23,7 @@ static int mx25_read_cpu_rev(void) np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); rev = readl(iim_base + MXC_IIMSREV); iounmap(iim_base); diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c index bf70e13bbe9e..1d2893908368 100644 --- a/arch/arm/mach-imx/cpu-imx27.c +++ b/arch/arm/mach-imx/cpu-imx27.c @@ -28,6 +28,7 @@ static int mx27_read_cpu_rev(void) np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm"); ccm_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!ccm_base); /* * now we have access to the IO registers. As we need diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c index b9c24b851d1a..35c544924e50 100644 --- a/arch/arm/mach-imx/cpu-imx31.c +++ b/arch/arm/mach-imx/cpu-imx31.c @@ -39,6 +39,7 @@ static int mx31_read_cpu_rev(void) np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); /* read SREV register from IIM module */ diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c index 80e7d8ab9f1b..1fe75b39c2d9 100644 --- a/arch/arm/mach-imx/cpu-imx35.c +++ b/arch/arm/mach-imx/cpu-imx35.c @@ -21,6 +21,7 @@ static int mx35_read_cpu_rev(void) np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim"); iim_base = of_iomap(np, 0); + of_node_put(np); BUG_ON(!iim_base); rev = imx_readl(iim_base + MXC_IIMSREV); diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c index ad56263778f9..a67c89bf155d 100644 --- a/arch/arm/mach-imx/cpu-imx5.c +++ b/arch/arm/mach-imx/cpu-imx5.c @@ -28,6 +28,7 @@ static u32 imx5_read_srev_reg(const char *compat) np = of_find_compatible_node(NULL, NULL, compat); iim_base = of_iomap(np, 0); + of_node_put(np); WARN_ON(!iim_base); srev = readl(iim_base + IIM_SREV) & 0xff; -- 2.32.0