aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2009-02-26 04:53:11 -0500
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 06:40:00 -0400
commitf8b4ece2a94693b7d2dd32ea716cb92545b5dce6 (patch)
tree9ab0400f03b975ea2d447a0694779c0d3342028e
parent6d9609c13250631c1d0c55a29a64d5687fd91293 (diff)
kmemcheck: use kmemcheck_pte_lookup() instead of open-coding it
Lets use kmemcheck_pte_lookup() in kmemcheck_fault() instead of open-coding it there. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
-rw-r--r--arch/x86/mm/kmemcheck/kmemcheck.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
index a644f248451b..6931e5115bcd 100644
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -611,7 +611,6 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
611 unsigned long error_code) 611 unsigned long error_code)
612{ 612{
613 pte_t *pte; 613 pte_t *pte;
614 unsigned int level;
615 614
616 /* 615 /*
617 * XXX: Is it safe to assume that memory accesses from virtual 86 616 * XXX: Is it safe to assume that memory accesses from virtual 86
@@ -624,13 +623,9 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
624 if (regs->cs != __KERNEL_CS) 623 if (regs->cs != __KERNEL_CS)
625 return false; 624 return false;
626 625
627 pte = lookup_address(address, &level); 626 pte = kmemcheck_pte_lookup(address);
628 if (!pte) 627 if (!pte)
629 return false; 628 return false;
630 if (level != PG_LEVEL_4K)
631 return false;
632 if (!pte_hidden(*pte))
633 return false;
634 629
635 if (error_code & 2) 630 if (error_code & 2)
636 kmemcheck_access(regs, address, KMEMCHECK_WRITE); 631 kmemcheck_access(regs, address, KMEMCHECK_WRITE);