From: Dan Carpenter Date: Fri, 8 Nov 2013 09:45:33 +0000 (+0300) Subject: metag: off by one in setup_bootmem_node() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51387306b5c2b0c9eb1e2556de1b37267bb2b583;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git metag: off by one in setup_bootmem_node() If "nid == MAX_NUMNODES" then we write beyond the end of the node_data[] array. Signed-off-by: Dan Carpenter Signed-off-by: James Hogan --- diff --git a/arch/metag/mm/numa.c b/arch/metag/mm/numa.c index 9ae578c9b620..b172aa45fcf8 100644 --- a/arch/metag/mm/numa.c +++ b/arch/metag/mm/numa.c @@ -34,7 +34,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) unsigned long pgdat_paddr; /* Don't allow bogus node assignment */ - BUG_ON(nid > MAX_NUMNODES || nid <= 0); + BUG_ON(nid >= MAX_NUMNODES || nid <= 0); start_pfn = start >> PAGE_SHIFT; end_pfn = end >> PAGE_SHIFT;