lkml.org 
[lkml]   [2013]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mfd: Fix memory leak in mfd_add_devices()
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-12-04 10:01    [W:0.047 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site