diff --git a/xen/common/memory.c b/xen/common/memory.c index 1f0a9d7e5f..9b23cd0bdb 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -1678,6 +1678,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg) rc = xsm_claim_pages(XSM_PRIV, d); + if ( !rc && d->is_dying ) + rc = -EINVAL; + if ( !rc ) rc = domain_set_outstanding_pages(d, reservation.nr_extents);