From: Luiz Capitulino <lcapitulino@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: bigeasy@linutronix.de, tglx@linutronix.de, anna-maria@linutronix.de
Subject: [PATCH 2/2] x86/x2apic: check return value on probe
Date: Thu, 4 Aug 2016 10:56:00 -0400 [thread overview]
Message-ID: <1470322560-18333-3-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1470322560-18333-1-git-send-email-lcapitulino@redhat.com>
cpuhp_setup_state() can fail. If it does, we have to
return 0 to upper layers.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
arch/x86/kernel/apic/x2apic_cluster.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 18b1704..eb4e459 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -187,12 +187,14 @@ int x2apic_dead_cpu(unsigned int this_cpu)
static int x2apic_cluster_probe(void)
{
+ int ret;
+
if (!x2apic_mode)
return 0;
- cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE",
+ ret = cpuhp_setup_state(CPUHP_X2APIC_PREPARE, "X2APIC_PREPARE",
x2apic_prepare_cpu, x2apic_dead_cpu);
- return 1;
+ return ret < 0 ? 0 : 1;
}
static const struct cpumask *x2apic_cluster_target_cpus(void)
--
2.5.5
next prev parent reply other threads:[~2016-08-04 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 14:55 [PATCH 0/2] x86/x2apic: fix conversion to CPU hotplug state machine Luiz Capitulino
2016-08-04 14:55 ` [PATCH 1/2] x86/x2apic: fix NULL pointer def during boot Luiz Capitulino
2016-08-04 18:45 ` Davidlohr Bueso
2016-08-10 8:26 ` Igor Mammedov
2016-08-10 8:38 ` Igor Mammedov
2016-08-04 14:56 ` Luiz Capitulino [this message]
2016-08-09 13:28 ` [PATCH 0/2] x86/x2apic: fix conversion to CPU hotplug state machine Luiz Capitulino
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=1470322560-18333-3-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=anna-maria@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®