aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xen/common/compat/memory.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 491a9ce568..17519f5688 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -250,7 +250,7 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat)
case XENMEM_decrease_reservation:
case XENMEM_populate_physmap:
end_extent = split >= 0 ? rc : cmd >> MEMOP_EXTENT_SHIFT;
- if ( op != XENMEM_decrease_reservation &&
+ if ( (op != XENMEM_decrease_reservation) &&
!guest_handle_is_null(nat.rsrv->extent_start) )
{
for ( ; start_extent < end_extent; ++start_extent )
@@ -276,13 +276,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat)
break;
}
}
-
- /* Bail if there was an error. */
- if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) )
- split = 0;
}
else
+ {
start_extent = end_extent;
+ }
+ /* Bail if there was an error. */
+ if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) )
+ split = 0;
break;
case XENMEM_exchange: