* [patch] sh: off by one in setup_bootmem_node()
@ 2013-11-08 9:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-11-08 9:44 UTC (permalink / raw)
To: linux-sh
If "nid = MAX_NUMNODES" then we would write one space past the end of
the array later on in the function.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c
index 3d85225..bce52ba 100644
--- a/arch/sh/mm/numa.c
+++ b/arch/sh/mm/numa.c
@@ -31,7 +31,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
unsigned long bootmem_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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-08 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 9:44 [patch] sh: off by one in setup_bootmem_node() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox