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....@linux.intel.com>
---
 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() )
         return;
 
     /* Domain is destroyed so its cos_ref should be decreased. */
-- 
1.9.1


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

Reply via email to