summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss Anderson <rja@sgi.com>2012-05-10 13:01:46 -0700
committerBen Hutchings <ben@decadent.org.uk>2012-05-20 22:56:33 +0100
commiteceb33799bdb35305f9af781d07caa10d05958fe (patch)
tree013993af39f044b0de674221cae97eae81b0421a
parent97a2373e32df28a6e59de89b725d4dbe58076a8d (diff)
downloadlinux-stable-eceb33799bdb35305f9af781d07caa10d05958fe.tar.gz
linux-stable-eceb33799bdb35305f9af781d07caa10d05958fe.tar.bz2
linux-stable-eceb33799bdb35305f9af781d07caa10d05958fe.zip
mm: nobootmem: fix sign extend problem in __free_pages_memory()
commit 6bc2e853c6b46a6041980d58200ad9b0a73a60ff upstream. Systems with 8 TBytes of memory or greater can hit a problem where only the the first 8 TB of memory shows up. This is due to "int i" being smaller than "unsigned long start_aligned", causing the high bits to be dropped. The fix is to change `i' to unsigned long to match start_aligned and end_aligned. Thanks to Jack Steiner for assistance tracking this down. Signed-off-by: Russ Anderson <rja@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Tejun Heo <tj@kernel.org> Cc: David S. Miller <davem@davemloft.net> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--mm/nobootmem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index 7fa41b4a07bf..07c08c4db1d2 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -83,8 +83,7 @@ void __init free_bootmem_late(unsigned long addr, unsigned long size)
static void __init __free_pages_memory(unsigned long start, unsigned long end)
{
- int i;
- unsigned long start_aligned, end_aligned;
+ unsigned long i, start_aligned, end_aligned;
int order = ilog2(BITS_PER_LONG);
start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);