]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
authorZhengyuan Liu <liuzhengyuan@tj.kylinos.cn>
Mon, 21 Sep 2020 02:39:36 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:42 +0000 (11:08 +0100)
commit0a2cb1eae0a70acf701600b510de04c55404bb31
tree3f86c214bb30ee3d47c336e90db2fda3941481d7
parent37ad7b2cca29201c6e88a8621508fe81c70b31e4
arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE

[ Upstream commit a194c5f2d2b3a05428805146afcabe5140b5d378 ]

The @node passed to cpumask_of_node() can be NUMA_NO_NODE, in that
case it will trigger the following WARN_ON(node >= nr_node_ids) due to
mismatched data types of @node and @nr_node_ids. Actually we should
return cpu_all_mask just like most other architectures do if passed
NUMA_NO_NODE.

Also add a similar check to the inline cpumask_of_node() in numa.h.

Signed-off-by: Zhengyuan Liu <liuzhengyuan@tj.kylinos.cn>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20200921023936.21846-1-liuzhengyuan@tj.kylinos.cn
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/include/asm/numa.h
arch/arm64/mm/numa.c