Commit f4dee85e authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle

[MIPS] sparsemem: fix crash in show_mem

With sparsemem, pfn should be checked by pfn_valid() before pfn_to_page().
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent bddc8134
...@@ -15,6 +15,8 @@ void show_mem(void) ...@@ -15,6 +15,8 @@ void show_mem(void)
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
pfn = max_mapnr; pfn = max_mapnr;
while (pfn-- > 0) { while (pfn-- > 0) {
if (!pfn_valid(pfn))
continue;
page = pfn_to_page(pfn); page = pfn_to_page(pfn);
total++; total++;
if (PageHighMem(page)) if (PageHighMem(page))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment