diff options
-rw-r--r-- | linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c index 41808f1711..b0d0914a14 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c @@ -67,8 +67,11 @@ int mtrr_add_page(unsigned long base, unsigned long size, op.u.add_memtype.pfn = base; op.u.add_memtype.nr_pfns = size; op.u.add_memtype.type = type; - if ((error = HYPERVISOR_dom0_op(&op))) + error = HYPERVISOR_dom0_op(&op); + if (error) { + BUG_ON(error > 0); return error; + } if (increment) ++usage_table[op.u.add_memtype.reg]; @@ -121,8 +124,12 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) if (--usage_table[reg] < 1) { op.cmd = DOM0_DEL_MEMTYPE; op.u.del_memtype.handle = 0; - op.u.add_memtype.reg = reg; - (void)HYPERVISOR_dom0_op(&op); + op.u.del_memtype.reg = reg; + error = HYPERVISOR_dom0_op(&op); + if (error) { + BUG_ON(error > 0); + goto out; + } } error = reg; out: |