[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f9847b8bd15ad5056255150c71df37f2f74bc080.1466844557.git.yu.c.chen@intel.com>
Date: Sun, 26 Jun 2016 00:18:30 +0800
From: Chen Yu <yu.c.chen@...el.com>
To: linux-pm@...r.kernel.org, x86@...nel.org
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...e.de>,
Pavel Machek <pavel@....cz>, Brian Gerst <brgerst@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Varun Koyyalagunta <cpudebug@...ttech.com>,
linux-kernel@...r.kernel.org, Chen Yu <yu.c.chen@...el.com>
Subject: [PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL
frozen_cpus might be NULL if the allocation in previous
alloc_frozen_cpus failed, when CONFIG_CPUMASK_OFFSTACK
is set.
This patch avoid accessing this cpumask if it is NULL.
Signed-off-by: Chen Yu <yu.c.chen@...el.com>
---
kernel/cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index d948e44..d25266e 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1021,6 +1021,8 @@ int disable_nonboot_cpus(void)
{
int cpu, first_cpu, error = 0;
+ if (frozen_cpus == NULL)
+ return -ENOMEM;
cpu_maps_update_begin();
first_cpu = cpumask_first(cpu_online_mask);
/*
@@ -1072,6 +1074,8 @@ void enable_nonboot_cpus(void)
{
int cpu, error;
+ if (frozen_cpus == NULL)
+ return;
/* Allow everyone to use the CPU hotplug again */
cpu_maps_update_begin();
WARN_ON(--cpu_hotplug_disabled < 0);
--
2.7.4
Powered by blists - more mailing lists