2022-12-06 17:21:08

by Dario Binacchi

[permalink] [raw]
Subject: [PATCH 0/5] ARM: imx: add missing of_node_put()

The 5 patches in the series fix the same problem on different platforms.
In doing so it is possible to add to each of them the tag "Fixes" which
identifies the commit they fix.


Dario Binacchi (5):
ARM: imx25: add missing of_node_put()
ARM: imx27: add missing of_node_put()
ARM: imx31: add missing of_node_put()
ARM: imx35: add missing of_node_put()
ARM: imx5: add missing of_node_put()

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(+)

--
2.32.0


2022-12-06 17:37:33

by Dario Binacchi

[permalink] [raw]
Subject: [PATCH 3/5] ARM: imx31: add missing of_node_put()

In mx31_read_cpu_rev(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: 3172225d45bd9 ("ARM: imx31: Retrieve the IIM base address from devicetree")
Signed-off-by: Dario Binacchi <[email protected]>
---

arch/arm/mach-imx/cpu-imx31.c | 1 +
1 file changed, 1 insertion(+)

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 */
--
2.32.0

2022-12-06 17:38:17

by Dario Binacchi

[permalink] [raw]
Subject: [PATCH 2/5] ARM: imx27: add missing of_node_put()

In mx27_read_cpu_rev(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: 94b2bec1b0e05 ("ARM: imx27: Retrieve the SYSCTRL base address from devicetree")
Signed-off-by: Dario Binacchi <[email protected]>
---

arch/arm/mach-imx/cpu-imx27.c | 1 +
1 file changed, 1 insertion(+)

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
--
2.32.0

2022-12-06 17:55:57

by Dario Binacchi

[permalink] [raw]
Subject: [PATCH 5/5] ARM: imx5: add missing of_node_put()

In imx5_read_srev_reg(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: ee18a7154ee08 ("ARM: imx5: retrieve iim base from device tree")
Signed-off-by: Dario Binacchi <[email protected]>

---

arch/arm/mach-imx/cpu-imx5.c | 1 +
1 file changed, 1 insertion(+)

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

2022-12-06 18:02:10

by Dario Binacchi

[permalink] [raw]
Subject: [PATCH 1/5] ARM: imx25: add missing of_node_put()

In mx25_read_cpu_rev(), of_find_compatible_node() returns a node pointer
with refcount incremented. Use of_node_put() on it when done.

Fixes: 8b88f7ef31dde ("ARM: mx25: Retrieve IIM base from dt")
Signed-off-by: Dario Binacchi <[email protected]>
---

arch/arm/mach-imx/cpu-imx25.c | 1 +
1 file changed, 1 insertion(+)

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);
--
2.32.0

2022-12-06 21:21:41

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 0/5] ARM: imx: add missing of_node_put()

On Tue, Dec 6, 2022, at 18:10, Dario Binacchi wrote:
> The 5 patches in the series fix the same problem on different platforms.
> In doing so it is possible to add to each of them the tag "Fixes" which
> identifies the commit they fix.

I think these should be combined into a single patch after all.
It's not a problem to have multiple 'Fixes' tags pointing to
different commits here, as the patches would not get backported
to a different set of kernels.

Arnd