Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6eade8ff461fdf13ec6780602eb5618e0bdaa972 Commit: 6eade8ff461fdf13ec6780602eb5618e0bdaa972 Parent: 4692a1450b4d1000a942022b088c8791749dd65e Author: Thomas Gleixner <[EMAIL PROTECTED]> AuthorDate: Wed Jan 30 13:34:08 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Wed Jan 30 13:34:08 2008 +0100
x86: cpa: clean up change_page_attr_set/clear() Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> --- arch/x86/mm/pageattr.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 5cfc0d4..145f5ed 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -312,10 +312,10 @@ static int change_page_attr_set(unsigned long addr, int numpages, for (i = 0; i < numpages ; i++) { pte = lookup_address(addr, &level); - if (pte) - current_prot = pte_pgprot(*pte); - else - pgprot_val(current_prot) = 0; + if (!pte) + return -EINVAL; + + current_prot = pte_pgprot(*pte); pgprot_val(new_prot) = pgprot_val(current_prot) | pgprot_val(prot); @@ -356,11 +356,12 @@ static int change_page_attr_clear(unsigned long addr, int numpages, int i, ret; for (i = 0; i < numpages; i++) { + pte = lookup_address(addr, &level); - if (pte) - current_prot = pte_pgprot(*pte); - else - pgprot_val(current_prot) = 0; + if (!pte) + return -EINVAL; + + current_prot = pte_pgprot(*pte); pgprot_val(new_prot) = pgprot_val(current_prot) & ~pgprot_val(prot); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html