Skip to content

Commit

Permalink
kmemcheck: use kmemcheck_pte_lookup() instead of open-coding it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pekka Enberg authored and Vegard Nossum committed Jun 15, 2009
1 parent 6d9609c commit f8b4ece
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arch/x86/mm/kmemcheck/kmemcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
pte_t *pte;
unsigned int level;

/*
* XXX: Is it safe to assume that memory accesses from virtual 86
Expand All @@ -624,13 +623,9 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
if (regs->cs != __KERNEL_CS)
return false;

pte = lookup_address(address, &level);
pte = kmemcheck_pte_lookup(address);
if (!pte)
return false;
if (level != PG_LEVEL_4K)
return false;
if (!pte_hidden(*pte))
return false;

if (error_code & 2)
kmemcheck_access(regs, address, KMEMCHECK_WRITE);
Expand Down

0 comments on commit f8b4ece

Please sign in to comment.