From patchwork Thu Dec 8 16:54:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2517 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 99C763F042 for ; Thu, 8 Dec 2022 17:54:15 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id y18-20020a056402359200b004635f8b1bfbsf1252413edc.17 for ; Thu, 08 Dec 2022 08:54:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670518455; cv=pass; d=google.com; s=arc-20160816; b=jnTqisajn2jKkBRukMQTKz0y9h+nqdsSqMXTko8hoIZLNhb17LcxFSZsqL3fUQBVn0 jtpDZqq4/fCPar284x5ZWAQU1Pc7TPWOI4rksU2rNwQGzI6D/44zenNEe1witgDtLmZZ APqUrZf0F2ThVAW4F2tcw2XHsCLrR048IZzEJ1QOCjkjv6sK9RmcTG4Pwd9NlAjrJHkR BqyQs1QcBGfd3H4YBBj0Mh3bcUpajlT9ZNOPrT6aVo5JspPumLkO6FQ5hgEE2IoygdTJ pFxZjX/RCkJ+HZ8QxTp50zcFwH4bhfX8+7MA33GevQp0dyLq7nNn72CdoHMIT9USYU7N mJGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7XjcsOsuQ7sJi++QoFteHYOvxcYFtjMDeJAR8GeokWk=; b=XmtDextqIaImVrl6H8q2adBptxalyjR96n8ZwDprzU0ByMv8f6HoMzuWXNYzot+uB0 o1Sl/s87LAWE3yJkw62D0v/Qxlq/kFxA42mThn+ONcIKx6WF9XdiVKKHiVnqMH3eMGL5 SzYz7a+0dc3AsWL2r4lmUuKtjrhTZU/oBOdzQMcOCOuTb6HCEgsVenEsdt1fuF90+MkK 2wVn8xZ1FXBt8FbzJ6TxS0YVECV87xsLI6ZIgpZ1C7ERuZudCpEaklbs4fxOi4i9UumY gHOgIXJduHMSQTJT9Te46Az84rPovJ1HhX5oHjkVTMSe/vpTBKkK1EEnth49PoaT1H1P KX2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iiolJJcK; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=7XjcsOsuQ7sJi++QoFteHYOvxcYFtjMDeJAR8GeokWk=; b=bQapGt58JHvfHcTO0/ZwKaqdsNTQ7Q/X0+Q0jgKsgOWoWNlxtPlHg89dlEMfZdxcD9 0pSnLhCSWgQMqWazk0Ljj1gwRwrh0C4wqBYLJ5FiIn7OZeXYzgO0SovvyuJISgIZmlKs QQtdZGHNRwB1sHbXzkCPEhnmBuV/5UTkW0Gu4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=7XjcsOsuQ7sJi++QoFteHYOvxcYFtjMDeJAR8GeokWk=; b=tBAoQVkPL5gZ+2WzMAuerVUxYzT3oVh7OKSOZqO6XX3Jc/Q3QfstCumoCJD3kzc8T5 6B70e1l4Mw+8ZTygbd60HonLFHX2JeQ3sUFlykASReV1hdcUbyOLOpg1HWBAr2K3B1eE ftXyVkpNX7lEIsUsaTegBWFtI5+Q0FHCquhEUuXSx2KAcSqHZJmavbk+HBcHYBftIidJ +5aBlPtqkvdNxjKXgzYpoZQK3wSVfR2GUQ9gToo9aFKAS2JvD08INIMwaJAGYZHLgNAO KsE0v7pjzvs5sRAYHUAtj4gp10Ot/nSiolntuk6eBNpW3h7HH9+zSykXpUxw6c4OjSSL mvNA== X-Gm-Message-State: ANoB5pmMhTHckq4Wv2++9WMown8lY+CdBMRk9t+5g9x287DGlFjlwYeZ FVIa8qmpgm3DM+k/9W29WVoaAaWg X-Google-Smtp-Source: AA0mqf5rTwKPnAJt9vHCzy41WbX1MBF1dISJ2MiGvviMBv/yzvUpBHhKl1OkIQZicpN6z7MDkCzeIQ== X-Received: by 2002:a05:6402:4486:b0:46c:cff7:f80d with SMTP id er6-20020a056402448600b0046ccff7f80dmr13281221edb.361.1670518455382; Thu, 08 Dec 2022 08:54:15 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:9614:b0:78d:e7b8:d105 with SMTP id s20-20020a170906961400b0078de7b8d105ls3264486ejx.8.-pod-prod-gmail; Thu, 08 Dec 2022 08:54:14 -0800 (PST) X-Received: by 2002:a17:906:8684:b0:7c1:a0e:77 with SMTP id g4-20020a170906868400b007c10a0e0077mr9357322ejx.29.1670518454233; Thu, 08 Dec 2022 08:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670518454; cv=none; d=google.com; s=arc-20160816; b=M5IdcJ52FzpkXqxbVVVOG3GLQa1WPrUL6mPtR3jYSnXb8PRErCSuOGtvdBvYGhM87X P9SnaGx/cS9z+nVhYZuMUzp8ySyeZ650daar8be+TbrWd7mvtoFpmpqtyI9q38gb1g5d kNez9cICVaMqTwSo9BVUMn4B4btIoD7tOn++6XN/AdIzGdGDbRnzHlBWfLoFi5CuFqUM BgJdrniOsB9EwkBzJm4DOvqdCWDNSgz/abTluDsDdk8d8nVXgswjQKz7Uea0MnbzWwbP ZTj2BXBoskm4G32y0J+z1EpCgMjEA0cKNcbMjEWY8+jjdUGHTFLRxguN+huMFalEJcPE IkQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=lALHATX+hiDxRwsr9MpdMABICaz3d1AN8racNeFX2to=; b=dC61jbHLJ80ZTUk1EUw8o9nXHuhafD3KZ+f4v1gDHvbYTqyUkzmjb7eUw5Bn6mYA6P t3CfiurDQiGTVvcdnnPH9Qu06ryhWt6ZsH9zxMv14ppFxvhbOLSl0kQsH3MoWfr41nQM jPAkLZdq+VmYlC4fD+WURzLsG1oOZ+EeFirbu3TY8U8gBI4ic3xZEZBsDjtdsSZJqlbn 295xXtTVl4U5nGED+SA20aY1O2tSIX8lJ9almGnnTaKXslHzysgD7dEcXww0I49Ot1J4 It31sXQ5wSXHfFvDcbAaJsIhYrvUNGF1BOOFM6mc65XcFg9WwrrJRQWkZW3iVZOB5DaO 797Q== 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 dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id bq16-20020a056402215000b0046b29341739sor331090edb.63.2022.12.08.08.54.14 for (Google Transport Security); Thu, 08 Dec 2022 08:54:14 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iiolJJcK; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Fabio Estevam Reviewed-by: Martin Kaiser --- 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;