summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-12-11 02:41:31 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 04:41:02 +0300
commitded00142740f54610b7e256201c45a3bfa5f14e5 (patch)
tree58fca4bbb311699da22f7e96ba38ffe1bb13c2ae /arch/sh
parent7b990789a4c3420fa57596b368733158e432d444 (diff)
downloadlinux-ded00142740f54610b7e256201c45a3bfa5f14e5.tar.xz
sh: off by one BUG_ON() in setup_bootmem_node()
This off by one bug is harmless but it upsets the static checkers and the code is obvious so it doesn't hurt to fix it. The Smatch warning is: arch/sh/mm/numa.c:47 setup_bootmem_node() error: buffer overflow 'node_data' 1024 <= 1024 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Paul Mundt <lethal@linux-sh.org> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/numa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c
index 3d85225b9e95..bce52ba66206 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;