summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Garry <john.g.garry@oracle.com>2026-02-10 19:31:12 +0800
committerSasha Levin <sashal@kernel.org>2026-03-04 07:20:53 -0500
commitb5bf05e05cdf489a04137e4da407de9d4cca5295 (patch)
treecd81c902d9791dde2aa0b0f3a15892c6364e599f
parent757873abfc8ea38592582180aed0f57f0f0cb07a (diff)
LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE
[ Upstream commit 94b0c831eda778ae9e4f2164a8b3de485d8977bb ] The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which is a valid index - so add a check for this. Cc: stable@vger.kernel.org Signed-off-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/loongarch/include/asm/topology.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
index 66128dec0bf6..6ff4cdc3d186 100644
--- a/arch/loongarch/include/asm/topology.h
+++ b/arch/loongarch/include/asm/topology.h
@@ -11,7 +11,7 @@
extern cpumask_t cpus_on_node[];
-#define cpumask_of_node(node) (&cpus_on_node[node])
+#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node])
struct pci_bus;
extern int pcibus_to_node(struct pci_bus *);