]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Mon, 20 Jun 2022 07:16:34 +0000 (03:16 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 20 Jun 2022 07:16:34 +0000 (03:16 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch [new file with mode: 0644]
queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch b/queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch
new file mode 100644 (file)
index 0000000..a0f4edf
--- /dev/null
@@ -0,0 +1,37 @@
+From e23f120ef9efd7ca43b32e3e723d04c7a6ca7490 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 1 Jun 2022 12:09:25 +0400
+Subject: irqchip/gic/realview: Fix refcount leak in realview_gic_of_init
+
+From: Miaoqian Lin <linmq006@gmail.com>
+
+[ Upstream commit f4b98e314888cc51486421bcf6d52852452ea48b ]
+
+of_find_matching_node_and_match() returns a node pointer with refcount
+incremented, we should use of_node_put() on it when not need anymore.
+Add missing of_node_put() to avoid refcount leak.
+
+Fixes: 82b0a434b436 ("irqchip/gic/realview: Support more RealView DCC variants")
+Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Link: https://lore.kernel.org/r/20220601080930.31005-2-linmq006@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/irqchip/irq-gic-realview.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/irqchip/irq-gic-realview.c b/drivers/irqchip/irq-gic-realview.c
+index 54c296401525..61024882c685 100644
+--- a/drivers/irqchip/irq-gic-realview.c
++++ b/drivers/irqchip/irq-gic-realview.c
+@@ -56,6 +56,7 @@ realview_gic_of_init(struct device_node *node, struct device_node *parent)
+       /* The PB11MPCore GIC needs to be configured in the syscon */
+       map = syscon_node_to_regmap(np);
++      of_node_put(np);
+       if (!IS_ERR(map)) {
+               /* new irq mode with no DCC */
+               regmap_write(map, REALVIEW_SYS_LOCK_OFFSET,
+-- 
+2.35.1
+
diff --git a/queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch b/queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch
new file mode 100644 (file)
index 0000000..125a825
--- /dev/null
@@ -0,0 +1,52 @@
+From b52e9f3d1230f4e59f0863d1d21ef6652fba62da Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 16 Sep 2017 01:59:41 +0800
+Subject: irqchip/gic-v3: Iterate over possible CPUs by for_each_possible_cpu()
+
+From: zijun_hu <zijun_hu@htc.com>
+
+[ Upstream commit 3fad4cdac235c5b13227d0c09854c689ae62c70b ]
+
+get_cpu_number() doesn't use existing helper to iterate over possible
+CPUs, It will cause an error in case of discontinuous @cpu_possible_mask
+such as 0b11110001, which can result from a core having failed to come
+up on a SMP machine.
+
+Fixed by using existing helper for_each_possible_cpu().
+
+Signed-off-by: zijun_hu <zijun_hu@htc.com>
+Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/irqchip/irq-gic-v3.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
+index 2ab6060031a4..9ae24ffb9b09 100644
+--- a/drivers/irqchip/irq-gic-v3.c
++++ b/drivers/irqchip/irq-gic-v3.c
+@@ -982,7 +982,7 @@ static int get_cpu_number(struct device_node *dn)
+ {
+       const __be32 *cell;
+       u64 hwid;
+-      int i;
++      int cpu;
+       cell = of_get_property(dn, "reg", NULL);
+       if (!cell)
+@@ -996,9 +996,9 @@ static int get_cpu_number(struct device_node *dn)
+       if (hwid & ~MPIDR_HWID_BITMASK)
+               return -1;
+-      for (i = 0; i < num_possible_cpus(); i++)
+-              if (cpu_logical_map(i) == hwid)
+-                      return i;
++      for_each_possible_cpu(cpu)
++              if (cpu_logical_map(cpu) == hwid)
++                      return cpu;
+       return -1;
+ }
+-- 
+2.35.1
+
index 12f78febc008618b43e341c0d5175b4a2d54f3bb..67b7b73ca60e5f54ff794645c4e2a07779953f27 100644 (file)
@@ -237,3 +237,5 @@ net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch
 random-credit-cpu-and-bootloader-seeds-by-default.patch
 pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch
 misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch
+irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch
+irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch