summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorVenki Pallipadi <venkatesh.pallipadi@intel.com>2007-03-26 12:03:19 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-27 08:55:56 -0700
commitec28297a562f2b022115b9eb82e4ea724d996240 (patch)
tree37443cab75290b45b65b491f6dd56882fad38dec /drivers/cpufreq/cpufreq.c
parent703071b5b93d88d5acb0edd5b9dd86c69ad970f2 (diff)
downloadblackbird-op-linux-ec28297a562f2b022115b9eb82e4ea724d996240.tar.gz
blackbird-op-linux-ec28297a562f2b022115b9eb82e4ea724d996240.zip
[PATCH] Fix maxcpus=1 trigerring BUG() in cpufreq
Ingo reported it on lkml in the thread "2.6.21-rc5: maxcpus=1 crash in cpufreq: kernel BUG at drivers/cpufreq/cpufreq.c:82!" This check added to remove_dev is symmetric to one in add_dev and handles callbacks for offline cpus cleanly. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f52facc570f5..3162010900c9 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1015,6 +1015,10 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
{
unsigned int cpu = sys_dev->id;
int retval;
+
+ if (cpu_is_offline(cpu))
+ return 0;
+
if (unlikely(lock_policy_rwsem_write(cpu)))
BUG();
OpenPOWER on IntegriCloud