Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec28297a authored by Venki Pallipadi's avatar Venki Pallipadi Committed by Linus Torvalds
Browse files

[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: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 703071b5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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();