thermal: cpu_cooling: Avoid accessing potentially freed structures
commit
289d72afddf83440117c35d864bf0c6309c1d011 upstream.
After the lock is dropped, it is possible that the cpufreq_dev gets
freed before we call get_level() and that can cause kernel to crash.
Drop the lock after we are done using the structure.
Resolved migration conflicts from kernel 4.9 to 4.14.
- allowed_cpus -> policy->related_cpus
Change-Id: Ib7f00f738b761e291d01abbd2bf9b5745ad404e8
Signed-off-by: Eunseok Choi <es10.choi@samsung.com>