Skip to content

Commit

Permalink
[PATCH] x86_64: minor odering correction to dump_pagetable()
Browse files Browse the repository at this point in the history
Checking of the validity of pointers should be consistently done before
dereferencing the pointer.

Signed-Off-By: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jan Beulich authored and Linus Torvalds committed Feb 5, 2006
1 parent 91522a9 commit d646bce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <asm/proto.h>
#include <asm/kdebug.h>
#include <asm-generic/sections.h>
#include <asm/kdebug.h>

/* Page fault error code bits */
#define PF_PROT (1<<0) /* or no page found */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d646bce

Please sign in to comment.