summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-08 12:14:55 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-08 12:14:55 +0100
commit5f7ee246850ba18a6a7bcb3d5eddb6db68354688 (patch)
treeae392d408cd49b912aab0b420cc3de89d7a176b7 /arch/x86
parentc1a0bf347c40dd4b0a5bb10fdf4de76a1fbbbe8c (diff)
downloadop-kernel-dev-5f7ee246850ba18a6a7bcb3d5eddb6db68354688.zip
op-kernel-dev-5f7ee246850ba18a6a7bcb3d5eddb6db68354688.tar.gz
x86/mm/numa: Check for failures in numa_clear_kernel_node_hotplug()
numa_clear_kernel_node_hotplug() uses memblock_set_node() without checking for failures. memblock_set_node() is a complex function that might extend the memblock array - which extension might fail - so check for this possibility. It's not supposed to happen (because realistically if we have so little memory that this fails then we likely won't be able to boot anyway), but do the check nevertheless. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Brad Spengler <spender@grsecurity.net> Cc: Chen Tang <imtangchen@gmail.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: PaX Team <pageexec@freemail.hu> Cc: Taku Izumi <izumi.taku@jp.fujitsu.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: y14sg1 <y14sg1@comcast.net> Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/mm/numa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index ede4506..f70c1ff 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -491,8 +491,10 @@ static void __init numa_clear_kernel_node_hotplug(void)
*/
for (i = 0; i < numa_meminfo.nr_blks; i++) {
struct numa_memblk *mb = numa_meminfo.blk + i;
+ int ret;
- memblock_set_node(mb->start, mb->end - mb->start, &memblock.reserved, mb->nid);
+ ret = memblock_set_node(mb->start, mb->end - mb->start, &memblock.reserved, mb->nid);
+ WARN_ON_ONCE(ret);
}
/*
OpenPOWER on IntegriCloud