From: Yi Sun <yi.y.sun@linux.intel.com>
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, boris.ostrovsky@oracle.com,
Yi Sun <yi.y.sun@linux.intel.com>,
jbeulich@suse.com
Subject: [PATCH] x86: remove an ASSERT to avoid crash when destroy a domain.
Date: Sat, 5 Aug 2017 09:26:38 +0800 [thread overview]
Message-ID: <1501896398-69885-1-git-send-email-yi.y.sun@linux.intel.com> (raw)
In-Reply-To: <1501838977-63404-2-git-send-email-yi.y.sun@linux.intel.com>
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@linux.intel.com>
---
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++ )
{
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-08-05 1:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 9:29 [Patch for staging 1/2] docs: remove a special character to avoid html creation error Yi Sun
2017-08-04 9:29 ` [Patch for staging 2/2] x86: remove an ASSERT to avoid crash when destroy a domain Yi Sun
2017-08-04 16:49 ` Jan Beulich
2017-08-05 1:26 ` Yi Sun [this message]
2017-08-06 9:34 ` [PATCH] " Jan Beulich
2017-08-07 1:21 ` Yi Sun
2017-08-07 1:50 ` [Patch for staging 2/2] x86: adjust place of " Yi Sun
2017-08-07 7:06 ` Jan Beulich
2017-08-07 10:19 ` Wei Liu
2017-08-07 10:48 ` Wei Liu
2017-08-04 11:08 ` [Patch for staging 1/2] docs: remove a special character to avoid html creation error Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1501896398-69885-1-git-send-email-yi.y.sun@linux.intel.com \
--to=yi.y.sun@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.