]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE
authorJohn Garry <john.g.garry@oracle.com>
Tue, 10 Feb 2026 11:31:12 +0000 (19:31 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 10 Feb 2026 11:31:12 +0000 (19:31 +0800)
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>
arch/loongarch/include/asm/topology.h

index f06e7ff25bb7cbe14d79e91ee97b1afd78f13b44..6b79d6183085a2dbb92dbf9b6fa26439165db49d 100644 (file)
@@ -12,7 +12,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 *);