Skip to content

Commit

Permalink
[PATCH] Fix maxcpus=1 trigerring BUG() in cpufreq
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Venki Pallipadi authored and Linus Torvalds committed Mar 27, 2007
1 parent 703071b commit ec28297
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit ec28297

Please sign in to comment.