From: John Garry Date: Tue, 10 Feb 2026 11:31:12 +0000 (+0800) Subject: LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE X-Git-Tag: v6.18.16~70 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=61a56df2fbaad3a4d00f0c6a904b5d1ee8982eb4;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Huacai Chen Signed-off-by: Sasha Levin --- diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h index f06e7ff25bb7c..6b79d6183085a 100644 --- a/arch/loongarch/include/asm/topology.h +++ b/arch/loongarch/include/asm/topology.h @@ -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 *);