diff options
author | Keir Fraser <keir@xen.org> | 2011-01-18 09:04:04 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-01-18 09:04:04 +0000 |
commit | 9fd6c06946e2d3782199547771f54d562cd0f85a (patch) | |
tree | 0350b752aed6361c3f85b3a8fa5e46e1504b3e6c | |
parent | 21b43fc5c06418d0e0feefe529c74037c9ed671a (diff) | |
download | xen-9fd6c06946e2d3782199547771f54d562cd0f85a.tar.gz xen-9fd6c06946e2d3782199547771f54d562cd0f85a.tar.bz2 xen-9fd6c06946e2d3782199547771f54d562cd0f85a.zip |
xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held
Broken in 20358:ecc649ec3675
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r-- | xen/arch/x86/domctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 6652aad8af..6fb5504d78 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -965,15 +965,15 @@ long arch_do_domctl( if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */ break; - ret = -ESRCH; - if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) ) - break; - ret = -EPERM; if ( !IS_PRIV(current->domain) && !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) ) break; + ret = -ESRCH; + if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) ) + break; + ret=0; if ( domctl->u.memory_mapping.add_mapping ) { |