Commit-ID: 426902b6a139a2eb22ca1e2c8ee8bdcf77cccf86 Gitweb: http://git.kernel.org/tip/426902b6a139a2eb22ca1e2c8ee8bdcf77cccf86 Author: Ingo Molnar <mingo@xxxxxxxxxx> AuthorDate: Mon, 8 Feb 2016 10:03:11 +0100 Committer: Ingo Molnar <mingo@xxxxxxxxxx> CommitDate: Mon, 8 Feb 2016 10:03:11 +0100 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@xxxxxxxxxxxxxxxxxxxx> Cc: Brad Spengler <spender@xxxxxxxxxxxxxx> Cc: Chen Tang <imtangchen@xxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Lai Jiangshan <laijs@xxxxxxxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: PaX Team <pageexec@xxxxxxxxxxx> Cc: Taku Izumi <izumi.taku@xxxxxxxxxxxxxx> Cc: Tang Chen <tangchen@xxxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Wen Congyang <wency@xxxxxxxxxxxxxx> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@xxxxxxxxxxxxxx> Cc: y14sg1 <y14sg1@xxxxxxxxxxx> Cc: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx> Cc: linux-kernel@xxxxxxxxxxxxxxx Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx> --- arch/x86/mm/numa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 4321686..77b8769 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); } /* -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |