thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()
authorXuewen Yan <xuewen.yan@unisoc.com>
Thu, 25 Aug 2022 11:40:17 +0000 (19:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:36 +0000 (12:34 +0200)
commit91fafd22f8520b4be6941d6066f58dd561ffa724
treeedd8103aaea923306e85eef683a636448a13e70f
parent81fb3ee298d5346a8db8ff47fd08662bb01a04cd
thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()

[ Upstream commit cff895277c8558221ba180aefe26799dcb4eec86 ]

Since the policy needs to be accessed first when obtaining cpu devices,
first check whether the policy is legal before this.

Fixes: 5130802ddbb1 ("thermal: cpu_cooling: Switch to QoS requests for freq limits")
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/cpufreq_cooling.c