aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobin C. Harding <tobin@kernel.org>2019-04-30 10:11:44 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-25 18:22:29 +0200
commit96f0be982c8a112d1dbf5eb520757f614764707c (patch)
treec418716e8edfd2dbe4cfd2fabdb1ac1515550105
parent2a9605f177f810297258df2805aa5c791ae468f0 (diff)
downloadlinux-yocto-96f0be982c8a112d1dbf5eb520757f614764707c.tar.gz
linux-yocto-96f0be982c8a112d1dbf5eb520757f614764707c.tar.bz2
linux-yocto-96f0be982c8a112d1dbf5eb520757f614764707c.zip
sched/cpufreq: Fix kobject memleak
[ Upstream commit 9a4f26cc98d81b67ecc23b890c28e2df324e29f3 ] 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 <tobin@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tobin C. Harding <tobin@kernel.org> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Viresh Kumar <viresh.kumar@linaro.org> Link: http://lkml.kernel.org/r/20190430001144.24890-1-tobin@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-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 1ccf77f6d346..d4ab9245e016 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);