From: Lee Jones <lee.jones@linaro.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andres Salomon <dilinger@queued.net>,
Samuel Ortiz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: Fix memory leak in mfd_add_devices()
Date: Wed, 4 Dec 2013 08:30:37 +0000 [thread overview]
Message-ID: <20131204083037.GE7469@lee--X1> (raw)
In-Reply-To: <1383058042-22706-1-git-send-email-geert@linux-m68k.org>
On Tue, 29 Oct 2013, Geert Uytterhoeven wrote:
> If the first call to mfd_add_device() fails, no child devices have been
> registered to the parent yet, and thus mfd_remove_devices() won't find
> anything to remove nor free.
> Hence the previously allocated array of atomic_t objects will leak.
>
> Free the array instead of calling mfd_remove_devices() on failure during
> the first loop iteration to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> drivers/mfd/mfd-core.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
Hmm... I didn't see my reply to this, but it has been applied for a
while.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2013-12-04 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 14:47 Geert Uytterhoeven
2013-12-04 8:30 ` Lee Jones [this message]
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=20131204083037.GE7469@lee--X1 \
--to=lee.jones@linaro.org \
--cc=dilinger@queued.net \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/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
all inboxes | Powered by JetHome®