linux-mips
[Top] [All Lists]

[PATCH] sparsemem: fix crash in show_mem

To: linux-mips@linux-mips.org
Subject: [PATCH] sparsemem: fix crash in show_mem
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 13 Jul 2006 23:01:50 +0900 (JST)
Cc: ralf@linux-mips.org, vagabon.xyz@gmail.com
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Resend with proper subject. (old subject was "do not count pages in
holes with sparsemem"


With sparsemem, pfn should be checked by pfn_valid() before pfn_to_page().

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index 792c6eb..c93aa6c 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -15,6 +15,8 @@ #ifndef CONFIG_NEED_MULTIPLE_NODES  /* X
        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))


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] sparsemem: fix crash in show_mem, Atsushi Nemoto <=