aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin C. Harding <[email protected]>2019-04-30 10:11:44 +1000
committerIngo Molnar <[email protected]>2019-04-30 07:57:23 +0200
commit9a4f26cc98d81b67ecc23b890c28e2df324e29f3 (patch)
treed121e33139a3a521e51a595d86675f108f3cb945
parent37624b58542fb9f2d9a70e6ea006ef8a5f66c30b (diff)
sched/cpufreq: Fix kobject memleak
Currently the error return path from kobject_init_and_add() is not followed by a call to kobject_put() - which means we are leaking the kobject. Fix it by adding a call to kobject_put() in the error path of kobject_init_and_add(). Signed-off-by: Tobin C. Harding <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tobin C. Harding <[email protected]> Cc: Vincent Guittot <[email protected]> Cc: Viresh Kumar <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/sched/cpufreq_schedutil.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 5c41ea367422..3638d2377e3c 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -771,6 +771,7 @@ out:
return 0;
fail:
+ kobject_put(&tunables->attr_set.kobj);
policy->governor_data = NULL;
sugov_tunables_free(tunables);