Skip to content

Commit

Permalink
[MIPS] sparsemem: fix crash in show_mem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Jul 13, 2006
1 parent bddc813 commit f4dee85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/mips/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ void show_mem(void)
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
pfn = max_mapnr;
while (pfn-- > 0) {
if (!pfn_valid(pfn))
continue;
page = pfn_to_page(pfn);
total++;
if (PageHighMem(page))
Expand Down

0 comments on commit f4dee85

Please sign in to comment.