summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2018-03-20 18:06:13 +0100
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2018-03-20 18:06:13 +0100
commitbb6a03d6659145bfb28425f9d3eb7ff97c1607c4 (patch)
tree809289f74a53a0b1c2fd1d8973c36bfe86a8867b /drivers/cpufreq
parentba4f591fc7d6defdfef5cef8dca1a60d9b9879b3 (diff)
parent42b96e19dddd6fa35aba5f57f8bcc284a4c3049d (diff)
downloadlinux-rt-bb6a03d6659145bfb28425f9d3eb7ff97c1607c4.tar.gz
Merge tag 'v4.14.28' into linux-4.14.y-rt
This is the 4.14.28 stable release
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index ea43b147a7fe..bb1e148ebfd4 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -631,6 +631,8 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
*governor = t;
err = 0;
}
+ if (t && !try_module_get(t->owner))
+ t = NULL;
mutex_unlock(&cpufreq_governor_mutex);
}
@@ -759,6 +761,10 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
return -EINVAL;
ret = cpufreq_set_policy(policy, &new_policy);
+
+ if (new_policy.governor)
+ module_put(new_policy.governor->owner);
+
return ret ? ret : count;
}