linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Tue, 16 Aug 2005 18:47:06 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/08/16 18:47:00

Modified files:
        arch/mips/lib-32: dump_tlb.c 

Log message:
        Add a few simple error checks.

diff -urN linux/arch/mips/lib-32/dump_tlb.c linux/arch/mips/lib-32/dump_tlb.c
--- linux/arch/mips/lib-32/dump_tlb.c   2005/08/16 17:06:48     1.5
+++ linux/arch/mips/lib-32/dump_tlb.c   2005/08/16 17:47:00     1.6
@@ -158,24 +158,27 @@
 
        if (addr > KSEG0)
                page_dir = pgd_offset_k(0);
-       else
+       else if (t->mm) {
                page_dir = pgd_offset(t->mm, 0);
-       printk("page_dir == %08x\n", (unsigned int) page_dir);
+               printk("page_dir == %08x\n", (unsigned int) page_dir);
+       } else
+               printk("Current thread has no mm\n");
 
        if (addr > KSEG0)
                pgd = pgd_offset_k(addr);
-       else
+       else if (t->mm) {
                pgd = pgd_offset(t->mm, addr);
-       printk("pgd == %08x, ", (unsigned int) pgd);
-
-       pud = pud_offset(pgd, addr);
-       printk("pud == %08x, ", (unsigned int) pud);
-
-       pmd = pmd_offset(pud, addr);
-       printk("pmd == %08x, ", (unsigned int) pmd);
-
-       pte = pte_offset(pmd, addr);
-       printk("pte == %08x, ", (unsigned int) pte);
+               printk("pgd == %08x, ", (unsigned int) pgd);
+               pud = pud_offset(pgd, addr);
+               printk("pud == %08x, ", (unsigned int) pud);
+
+               pmd = pmd_offset(pud, addr);
+               printk("pmd == %08x, ", (unsigned int) pmd);
+
+               pte = pte_offset(pmd, addr);
+               printk("pte == %08x, ", (unsigned int) pte);
+       } else
+               printk("Current thread has no mm\n");
 
        page = *pte;
 #ifdef CONFIG_64BIT_PHYS_ADDR

<Prev in Thread] Current Thread [Next in Thread>