From: Greg Kroah-Hartman Date: Fri, 6 Apr 2018 07:06:23 +0000 (+0200) Subject: Revert "cpufreq: Fix governor module removal race" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cfbed9b55636334f19059660b197fdffd40b8865;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Revert "cpufreq: Fix governor module removal race" This reverts commit 0049457bfde661cf47410eaacad65845c9a2bb45 which was commit a8b149d32b663c1a4105273295184b78f53d33cf upstream. The backport was not correct, so just drop it entirely. Reported-by: Ben Hutchings Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index bb1e148ebfd4..ea43b147a7fe 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -631,8 +631,6 @@ 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); } @@ -761,10 +759,6 @@ 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; }