]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Fix broken usage of governor->owner's refcount
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Aug 2013 17:23:10 +0000 (22:53 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 10 Aug 2013 01:24:47 +0000 (03:24 +0200)
commit5888e872d0f9d74e9e0a4f368073345f5daf24e0
tree0e87539040aabaf02babc0edc49fbb27610b0e3b
parent7ef37a38c97f1e4438f73e683b02223938cc71c8
cpufreq: Fix broken usage of governor->owner's refcount

The cpufreq governor owner refcount usage is broken.  We should only
increment that refcount when a CPUFREQ_GOV_POLICY_INIT event has come
and it should only be decremented if CPUFREQ_GOV_POLICY_EXIT has come.

Currently, there can be situations where the governor is in use, but
we have allowed it to be unloaded which may result in undefined
behavior.  Let's fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c