cpufreq: Fix locking issues with governors
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 29 Jun 2020 08:24:58 +0000 (13:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:15 +0000 (08:24 +0200)
commit98981082d5ba70547152021977826126babdc681
treeec711c4f82b32b798c440b424f5b4d5853b25d52
parent983e638fd8583f38265780a18445c3f95cb19e78
cpufreq: Fix locking issues with governors

commit 8cc46ae565c393f77417cb9530b1265eb50f5d2e upstream.

The locking around governors handling isn't adequate currently.

The list of governors should never be traversed without the locking
in place. Also governor modules must not be removed while the code
in them is still in use.

Reported-by: Quentin Perret <qperret@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: All applicable <stable@vger.kernel.org>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/cpufreq.c