From: Jan Beulich Date: Fri, 3 Feb 2006 20:51:47 +0000 (+0100) Subject: [PATCH] x86_64: minor odering correction to dump_pagetable() X-Git-Tag: v2.6.16-rc3~180 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d646bce4c77af72f5a293a96fbf14174c9f2a9c2;p=linux-2.6 [PATCH] x86_64: minor odering correction to dump_pagetable() Checking of the validity of pointers should be consistently done before dereferencing the pointer. Signed-Off-By: Jan Beulich Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 26eac19406..2e7c3c8ffe 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c @@ -33,7 +33,6 @@ #include #include #include -#include /* Page fault error code bits */ #define PF_PROT (1<<0) /* or no page found */ @@ -157,8 +156,8 @@ void dump_pagetable(unsigned long address) pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); pgd += pgd_index(address); - printk("PGD %lx ", pgd_val(*pgd)); if (bad_address(pgd)) goto bad; + printk("PGD %lx ", pgd_val(*pgd)); if (!pgd_present(*pgd)) goto ret; pud = __pud_offset_k((pud_t *)pgd_page(*pgd), address);