linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: mingo@kernel.org
Cc: torvalds@linux-foundation.org, gregkh@linuxfoundation.org,
	hpa@zytor.com, tglx@linutronix.de, vincent.guittot@linaro.org,
	peterz@infradead.org, rafael.j.wysocki@intel.com,
	tobin@kernel.org, linux-kernel@vger.kernel.org,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/urgent] sched/cpufreq: Fix kobject memleak
Date: Tue, 30 Apr 2019 11:26:27 +0530	[thread overview]
Message-ID: <20190430055627.oukh3dq6tk74q3wm@vireshk-i7> (raw)
In-Reply-To: <tip-8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8@git.kernel.org>

On 29-04-19, 22:52, tip-bot for Tobin C. Harding wrote:
> Commit-ID:  8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8
> Gitweb:     https://git.kernel.org/tip/8bf7ab9c79f3d1a5f02ebac369f656de9ec0aca8
> Author:     Tobin C. Harding <tobin@kernel.org>
> AuthorDate: Tue, 30 Apr 2019 10:11:44 +1000
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Tue, 30 Apr 2019 06:24:09 +0200
> 
> 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 <tobin@kernel.org>
> Add call to kobject_put() in error path of kobject_init_and_add().

This should have been present before the signed-off ?

> 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>
> ---
>  kernel/sched/cpufreq_schedutil.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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);
>  

-- 
viresh

  reply	other threads:[~2019-04-30  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  0:11 [PATCH] sched/cpufreq: Fix kobject memleak Tobin C. Harding
2019-04-30  4:22 ` Ingo Molnar
2019-04-30  5:52 ` [tip:sched/urgent] " tip-bot for Tobin C. Harding
2019-04-30  5:56   ` Viresh Kumar [this message]
2019-04-30  6:27     ` Tobin C. Harding
2019-04-30  6:01 ` tip-bot for Tobin C. Harding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430055627.oukh3dq6tk74q3wm@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tobin@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).