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

[Xen-devel] [Patch for staging 2/2] x86: remove an ASSERT to avoid crash when destroy a domain.

In 'psr_free_cos', we should not use 'ASSERT(socket_info)' because
the 'socket_info' is allocated only if 'psr' boot parameter is set.
So remove it and use 'psr_alloc_feat_enabled' to check if 'socket_info'
is valid or not to avoid crash.

Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx>
 xen/arch/x86/psr.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 7d9fa26..13c0daa 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -1294,9 +1294,7 @@ static void psr_free_cos(struct domain *d)
     unsigned int socket, cos;
-    ASSERT(socket_info);
-    if ( !d->arch.psr_cos_ids )
+    if ( !d->arch.psr_cos_ids || !psr_alloc_feat_enabled() )
     /* Domain is destroyed so its cos_ref should be decreased. */

Xen-devel mailing list



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