mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[CPUFREQ] remove redundant sprintf from request_module call.
Since format string handling is part of request_module, there is no need to construct the module name. As such, drop the redundant sprintf and heap usage. Signed-off-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
parent
469057d587
commit
1a8e1463a4
1 changed files with 6 additions and 13 deletions
|
@ -321,21 +321,14 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
|
||||||
t = __find_governor(str_governor);
|
t = __find_governor(str_governor);
|
||||||
|
|
||||||
if (t == NULL) {
|
if (t == NULL) {
|
||||||
char *name = kasprintf(GFP_KERNEL, "cpufreq_%s",
|
int ret;
|
||||||
str_governor);
|
|
||||||
|
|
||||||
if (name) {
|
mutex_unlock(&cpufreq_governor_mutex);
|
||||||
int ret;
|
ret = request_module("cpufreq_%s", str_governor);
|
||||||
|
mutex_lock(&cpufreq_governor_mutex);
|
||||||
|
|
||||||
mutex_unlock(&cpufreq_governor_mutex);
|
if (ret == 0)
|
||||||
ret = request_module("%s", name);
|
t = __find_governor(str_governor);
|
||||||
mutex_lock(&cpufreq_governor_mutex);
|
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
t = __find_governor(str_governor);
|
|
||||||
}
|
|
||||||
|
|
||||||
kfree(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t != NULL) {
|
if (t != NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue