mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "cpufreq: schedutil: Fix UAF issue"
This commit is contained in:
commit
bf7d133819
1 changed files with 5 additions and 3 deletions
|
|
@ -1296,12 +1296,14 @@ static void sugov_exit(struct cpufreq_policy *policy)
|
|||
|
||||
mutex_lock(&global_tunables_lock);
|
||||
|
||||
/* Save tunables before last owner release it in gov_attr_set_put() */
|
||||
if (tunables->attr_set.usage_count == 1)
|
||||
sugov_tunables_save(policy, tunables);
|
||||
|
||||
count = gov_attr_set_put(&tunables->attr_set, &sg_policy->tunables_hook);
|
||||
policy->governor_data = NULL;
|
||||
if (!count) {
|
||||
sugov_tunables_save(policy, tunables);
|
||||
if (!count)
|
||||
sugov_clear_global_tunables();
|
||||
}
|
||||
|
||||
mutex_unlock(&global_tunables_lock);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue