aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-07-13 10:01:50 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-07-13 16:26:22 -0400
commitf4dee85e2c6a7d7adf7ea4d6d3053a41c78175b7 (patch)
tree59bb468f05b99adbdbcef01195cff622585a337f /arch
parentbddc8134db00002a9fd1b33fcb45747bdd3a2777 (diff)
[MIPS] sparsemem: fix crash in show_mem
With sparsemem, pfn should be checked by pfn_valid() before pfn_to_page(). Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/mm/pgtable.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index 792c6eb44232..c93aa6cbcaca 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -15,6 +15,8 @@ void show_mem(void)
15 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 15 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
16 pfn = max_mapnr; 16 pfn = max_mapnr;
17 while (pfn-- > 0) { 17 while (pfn-- > 0) {
18 if (!pfn_valid(pfn))
19 continue;
18 page = pfn_to_page(pfn); 20 page = pfn_to_page(pfn);
19 total++; 21 total++;
20 if (PageHighMem(page)) 22 if (PageHighMem(page))