From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Tobin C. Harding" <tobin@kernel.org>
Cc: Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ocfs2: Fix error path kobject memory leak
Date: Mon, 13 May 2019 09:14:52 +0200 [thread overview]
Message-ID: <20190513071452.GG2868@kroah.com> (raw)
In-Reply-To: <20190513033458.2824-1-tobin@kernel.org>
On Mon, May 13, 2019 at 01:34:58PM +1000, Tobin C. Harding wrote:
> If a call to kobject_init_and_add() fails we should call kobject_put()
> otherwise we leak memory.
>
> Add call to kobject_put() in the error path of call to
> kobject_init_and_add(). Please note, this has the side effect that
> the release method is called if kobject_init_and_add() fails.
>
> Signed-off-by: Tobin C. Harding <tobin@kernel.org>
> ---
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Tobin C. Harding" <tobin@kernel.org>
Cc: Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH] ocfs2: Fix error path kobject memory leak
Date: Mon, 13 May 2019 09:14:52 +0200 [thread overview]
Message-ID: <20190513071452.GG2868@kroah.com> (raw)
In-Reply-To: <20190513033458.2824-1-tobin@kernel.org>
On Mon, May 13, 2019 at 01:34:58PM +1000, Tobin C. Harding wrote:
> If a call to kobject_init_and_add() fails we should call kobject_put()
> otherwise we leak memory.
>
> Add call to kobject_put() in the error path of call to
> kobject_init_and_add(). Please note, this has the side effect that
> the release method is called if kobject_init_and_add() fails.
>
> Signed-off-by: Tobin C. Harding <tobin@kernel.org>
> ---
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
next prev parent reply other threads:[~2019-05-13 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 3:34 [PATCH] ocfs2: Fix error path kobject memory leak Tobin C. Harding
2019-05-13 7:14 ` Greg Kroah-Hartman [this message]
2019-05-13 7:14 ` [Ocfs2-devel] " Greg Kroah-Hartman
2019-05-13 7:28 ` Joseph Qi
2019-05-13 7:28 ` [Ocfs2-devel] " Joseph Qi
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=20190513071452.GG2868@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=rafael@kernel.org \
--cc=tobin@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.