aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/mm/p2m.c
diff options
context:
space:
mode:
Diffstat (limited to 'xen/arch/x86/mm/p2m.c')
-rw-r--r--xen/arch/x86/mm/p2m.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 54940338d2..043a044626 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2207,7 +2207,10 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
if ( mfn_valid(_mfn(mfn)) )
{
if ( !set_p2m_entry(d, gfn, _mfn(mfn), page_order, t) )
+ {
rc = -EINVAL;
+ goto out; /* Failed to update p2m, bail without updating m2p. */
+ }
if ( !p2m_is_grant(t) )
{
for ( i = 0; i < (1UL << page_order); i++ )
@@ -2228,6 +2231,7 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn,
}
}
+out:
audit_p2m(d);
p2m_unlock(d->arch.p2m);