Skip to content
Snippets Groups Projects
Commit f1093739 authored by Viresh Kumar's avatar Viresh Kumar Committed by Junjie Wu
Browse files

cpufreq: check cpufreq driver is valid and cpufreq isn't disabled in cpufreq_get()


cpufreq_get() can be called from external drivers which might not be aware if
cpufreq driver is registered or not. And so we should actually check if cpufreq
driver is registered or not and also if cpufreq is active or disabled, at the
beginning of cpufreq_get().

Otherwise call to lock_policy_rwsem_read() might hit BUG_ON(!policy).

Reported-and-tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Git-commit: 26ca8694
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent ed0ea642
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment