From: Yi Sun Date: Mon, 7 Aug 2017 01:50:49 +0000 (+0800) Subject: x86: adjust place of an ASSERT to avoid crash when destroy a domain. X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1718 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dd050808ccc23f0a11d5596409f4245b9406a242;p=xen.git x86: adjust place of an ASSERT to avoid crash when destroy a domain. In 'psr_free_cos', we should not use 'ASSERT(socket_info)' at the beginning because the 'socket_info' is allocated only if 'psr' boot parameter is set. So adjust its place to avoid crash. Signed-off-by: Yi Sun Reviewed-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 7d9fa265f3..9ce8f17a18 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -1294,11 +1294,11 @@ static void psr_free_cos(struct domain *d) { unsigned int socket, cos; - ASSERT(socket_info); - if ( !d->arch.psr_cos_ids ) return; + ASSERT(socket_info); + /* Domain is destroyed so its cos_ref should be decreased. */ for ( socket = 0; socket < nr_sockets; socket++ ) {