Skip to content
Commit 932e130e authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get()



commit 943bdd0c upstream.

Currently there is an unlikely case where cpufreq_cpu_get() returns a
NULL policy and this will cause a NULL pointer dereference later on.

Fix this by passing the policy to transition_frequency_fidvid() from
the caller and hence eliminating the need for the cpufreq_cpu_get()
and cpufreq_cpu_put().

Thanks to Viresh Kumar for suggesting the fix.

Addresses-Coverity: ("Dereference null return")
Fixes: b43a7ffb ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()")
Suggested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a885713b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment