[xen master] x86: adjust place of an ASSERT to avoid crash when destroy a domain.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[xen master] x86: adjust place of an ASSERT to avoid crash when destroy a domain.

patchbot
commit dd050808ccc23f0a11d5596409f4245b9406a242
Author:     Yi Sun <[hidden email]>
AuthorDate: Mon Aug 7 09:50:49 2017 +0800
Commit:     Wei Liu <[hidden email]>
CommitDate: Mon Aug 7 11:46:59 2017 +0100

    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 <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
---
 xen/arch/x86/psr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 7d9fa26..9ce8f17 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++ )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog
Loading...