* [PATCH AUTOSEL 4.14 11/17] mips: mti-malta: Fix refcount leak in malta-time.c
[not found] <20220628022615.596977-1-sashal@kernel.org>
@ 2022-06-28 2:26 ` Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 12/17] mips: ralink: Fix refcount leak in of.c Sasha Levin
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit 608d94cb84c42585058d692f2fe5d327f8868cdb ]
In update_gic_frequency_dt(), 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 <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/mti-malta/malta-time.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index 66c866740ff2..eef336192d7f 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -231,6 +231,8 @@ static void update_gic_frequency_dt(void)
if (of_update_property(node, &gic_frequency_prop) < 0)
pr_err("error updating gic frequency property\n");
+
+ of_node_put(node);
}
#endif
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH AUTOSEL 4.14 12/17] mips: ralink: Fix refcount leak in of.c
[not found] <20220628022615.596977-1-sashal@kernel.org>
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 11/17] mips: mti-malta: Fix refcount leak in malta-time.c Sasha Levin
@ 2022-06-28 2:26 ` Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 13/17] mips: lantiq: falcon: Fix refcount leak bug in sysctrl Sasha Levin
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, john, linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit 48ca54e39173d1ed4c4dc8cf045484014bb26eaf ]
In plat_of_remap_node(), plat_of_remap_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 <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/ralink/of.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 1f7c686f7218..3cfd5809243e 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -42,6 +42,8 @@ __iomem void *plat_of_remap_node(const char *node)
if (of_address_to_resource(np, 0, &res))
panic("Failed to get resource for %s", node);
+ of_node_put(np);
+
if (!request_mem_region(res.start,
resource_size(&res),
res.name))
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH AUTOSEL 4.14 13/17] mips: lantiq: falcon: Fix refcount leak bug in sysctrl
[not found] <20220628022615.596977-1-sashal@kernel.org>
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 11/17] mips: mti-malta: Fix refcount leak in malta-time.c Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 12/17] mips: ralink: Fix refcount leak in of.c Sasha Levin
@ 2022-06-28 2:26 ` Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 14/17] mips: lantiq: xway: " Sasha Levin
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, john, xkernel.wang,
wangborong, linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit 72a2af539fff975caadd9a4db3f99963569bd9c9 ]
In ltq_soc_init(), 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 <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/lantiq/falcon/sysctrl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sysctrl.c
index 714d92659489..665739bd4190 100644
--- a/arch/mips/lantiq/falcon/sysctrl.c
+++ b/arch/mips/lantiq/falcon/sysctrl.c
@@ -210,6 +210,12 @@ void __init ltq_soc_init(void)
of_address_to_resource(np_sysgpe, 0, &res_sys[2]))
panic("Failed to get core resources");
+ of_node_put(np_status);
+ of_node_put(np_ebu);
+ of_node_put(np_sys1);
+ of_node_put(np_syseth);
+ of_node_put(np_sysgpe);
+
if ((request_mem_region(res_status.start, resource_size(&res_status),
res_status.name) < 0) ||
(request_mem_region(res_ebu.start, resource_size(&res_ebu),
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH AUTOSEL 4.14 14/17] mips: lantiq: xway: Fix refcount leak bug in sysctrl
[not found] <20220628022615.596977-1-sashal@kernel.org>
` (2 preceding siblings ...)
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 13/17] mips: lantiq: falcon: Fix refcount leak bug in sysctrl Sasha Levin
@ 2022-06-28 2:26 ` Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 15/17] mips/pic32/pic32mzda: Fix refcount leak bugs Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 16/17] mips: lantiq: Add missing of_node_put() in irq.c Sasha Levin
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, john, xkernel.wang,
linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit 76695592711ef1e215cc24ed3e1cd857d7fc3098 ]
In ltq_soc_init(), 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 <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/lantiq/xway/sysctrl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
index 1b1142c7bb85..454f10a8db50 100644
--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -439,6 +439,10 @@ void __init ltq_soc_init(void)
of_address_to_resource(np_ebu, 0, &res_ebu))
panic("Failed to get core resources");
+ of_node_put(np_pmu);
+ of_node_put(np_cgu);
+ of_node_put(np_ebu);
+
if (!request_mem_region(res_pmu.start, resource_size(&res_pmu),
res_pmu.name) ||
!request_mem_region(res_cgu.start, resource_size(&res_cgu),
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH AUTOSEL 4.14 15/17] mips/pic32/pic32mzda: Fix refcount leak bugs
[not found] <20220628022615.596977-1-sashal@kernel.org>
` (3 preceding siblings ...)
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 14/17] mips: lantiq: xway: " Sasha Levin
@ 2022-06-28 2:26 ` Sasha Levin
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 16/17] mips: lantiq: Add missing of_node_put() in irq.c Sasha Levin
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, yangtiezhu,
linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit eb9e9bc4fa5fb489c92ec588b3fb35f042ba6d86 ]
of_find_matching_node(), of_find_compatible_node() and
of_find_node_by_path() will return node pointers with refcout
incremented. We should call of_node_put() when they are not
used anymore.
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/pic32/pic32mzda/init.c | 7 ++++++-
arch/mips/pic32/pic32mzda/time.c | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c
index 406c6c5cec29..f8985d4573e6 100644
--- a/arch/mips/pic32/pic32mzda/init.c
+++ b/arch/mips/pic32/pic32mzda/init.c
@@ -131,13 +131,18 @@ static int __init pic32_of_prepare_platform_data(struct of_dev_auxdata *lookup)
np = of_find_compatible_node(NULL, NULL, lookup->compatible);
if (np) {
lookup->name = (char *)np->name;
- if (lookup->phys_addr)
+ if (lookup->phys_addr) {
+ of_node_put(np);
continue;
+ }
if (!of_address_to_resource(np, 0, &res))
lookup->phys_addr = res.start;
+ of_node_put(np);
}
}
+ of_node_put(root);
+
return 0;
}
diff --git a/arch/mips/pic32/pic32mzda/time.c b/arch/mips/pic32/pic32mzda/time.c
index 1894e50939b5..04879b85aac9 100644
--- a/arch/mips/pic32/pic32mzda/time.c
+++ b/arch/mips/pic32/pic32mzda/time.c
@@ -40,6 +40,9 @@ static unsigned int pic32_xlate_core_timer_irq(void)
goto default_map;
irq = irq_of_parse_and_map(node, 0);
+
+ of_node_put(node);
+
if (!irq)
goto default_map;
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH AUTOSEL 4.14 16/17] mips: lantiq: Add missing of_node_put() in irq.c
[not found] <20220628022615.596977-1-sashal@kernel.org>
` (4 preceding siblings ...)
2022-06-28 2:26 ` [PATCH AUTOSEL 4.14 15/17] mips/pic32/pic32mzda: Fix refcount leak bugs Sasha Levin
@ 2022-06-28 2:26 ` Sasha Levin
5 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Thomas Bogendoerfer, Sasha Levin, john, linux-mips
From: Liang He <windhl@126.com>
[ Upstream commit 3748d2185ac4c2c6f80989672253aad909ecaf95 ]
In icu_of_init(), 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 <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/lantiq/irq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
index 0476d7e97a03..6e3ace045b26 100644
--- a/arch/mips/lantiq/irq.c
+++ b/arch/mips/lantiq/irq.c
@@ -342,6 +342,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
if (!ltq_eiu_membase)
panic("Failed to remap eiu memory");
}
+ of_node_put(eiu_node);
return 0;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread