[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/physmap: Propagate error rc from xenmem_add_to_physmap_one



Error return code from xenmem_add_to_physmap_one() is not properly
handled in xenmem_add_to_physmap_batch().  This causes do_memory_op()
to return success to guest even though the underlying memory map fails.

Signed-off-by: Jiandi An <anjiandi@xxxxxxxxxxxxxx>
---
 xen/common/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 21797ca..4e46258 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -762,6 +762,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
         rc = xenmem_add_to_physmap_one(d, xatpb->space,
                                        xatpb->u,
                                        idx, _gfn(gpfn));
+        if ( rc < 0 )
+            goto out;
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, 0, &rc, 1)) )
         {
-- 
Jiandi An
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux 
Foundation Collaborative Project.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.