summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 13:34:07 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:34:07 +0100
commit4692a1450b4d1000a942022b088c8791749dd65e (patch)
treedc1195d1b927b6b9735f816ddce86b98e09ab65b /arch/x86
parenta72a08a4b61cb8868606a69b744848552e92062b (diff)
downloadlinux-3.10-4692a1450b4d1000a942022b088c8791749dd65e.tar.gz
linux-3.10-4692a1450b4d1000a942022b088c8791749dd65e.tar.bz2
linux-3.10-4692a1450b4d1000a942022b088c8791749dd65e.zip
x86: cpa: fix loop
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/mm/pageattr.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a2ee317548f..5cfc0d4ade5 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -304,7 +304,7 @@ static int change_page_attr_addr(unsigned long address, pgprot_t prot)
static int change_page_attr_set(unsigned long addr, int numpages,
pgprot_t prot)
{
- pgprot_t current_prot;
+ pgprot_t current_prot, new_prot;
int level;
pte_t *pte;
int i, ret;
@@ -317,9 +317,10 @@ static int change_page_attr_set(unsigned long addr, int numpages,
else
pgprot_val(current_prot) = 0;
- pgprot_val(prot) = pgprot_val(current_prot) | pgprot_val(prot);
+ pgprot_val(new_prot) =
+ pgprot_val(current_prot) | pgprot_val(prot);
- ret = change_page_attr_addr(addr, prot);
+ ret = change_page_attr_addr(addr, new_prot);
if (ret)
return ret;
addr += PAGE_SIZE;
@@ -349,7 +350,7 @@ static int change_page_attr_set(unsigned long addr, int numpages,
static int change_page_attr_clear(unsigned long addr, int numpages,
pgprot_t prot)
{
- pgprot_t current_prot;
+ pgprot_t current_prot, new_prot;
int level;
pte_t *pte;
int i, ret;
@@ -361,10 +362,10 @@ static int change_page_attr_clear(unsigned long addr, int numpages,
else
pgprot_val(current_prot) = 0;
- pgprot_val(prot) =
+ pgprot_val(new_prot) =
pgprot_val(current_prot) & ~pgprot_val(prot);
- ret = change_page_attr_addr(addr, prot);
+ ret = change_page_attr_addr(addr, new_prot);
if (ret)
return ret;
addr += PAGE_SIZE;