Commit 1a8e1463 authored by Kees Cook's avatar Kees Cook Committed by Dave Jones

[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: default avatarKees Cook <kees.cook@canonical.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 469057d5
...@@ -321,23 +321,16 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy, ...@@ -321,23 +321,16 @@ 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",
str_governor);
if (name) {
int ret; int ret;
mutex_unlock(&cpufreq_governor_mutex); mutex_unlock(&cpufreq_governor_mutex);
ret = request_module("%s", name); ret = request_module("cpufreq_%s", str_governor);
mutex_lock(&cpufreq_governor_mutex); mutex_lock(&cpufreq_governor_mutex);
if (ret == 0) if (ret == 0)
t = __find_governor(str_governor); t = __find_governor(str_governor);
} }
kfree(name);
}
if (t != NULL) { if (t != NULL) {
*governor = t; *governor = t;
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment