diff options
author | Sachin Kamat | 2012-09-24 08:35:03 +0200 |
---|---|---|
committer | Marek Szyprowski | 2012-09-24 08:35:03 +0200 |
commit | ec10665cbf271fb1f60daeb194ad4f2cdcdc59d9 (patch) | |
tree | 2b90e82535dc38d2d2f2dbf383f15e3b59d17879 /arch/arm/mm/dma-mapping.c | |
parent | Linux 3.6-rc7 (diff) | |
download | kernel-qcow2-linux-ec10665cbf271fb1f60daeb194ad4f2cdcdc59d9.tar.gz kernel-qcow2-linux-ec10665cbf271fb1f60daeb194ad4f2cdcdc59d9.tar.xz kernel-qcow2-linux-ec10665cbf271fb1f60daeb194ad4f2cdcdc59d9.zip |
ARM: dma-mapping: Fix potential memory leak in atomic_pool_init()
When either of __alloc_from_contiguous or __alloc_remap_buffer fails
to provide a valid pointer, allocated memory is freed up and an error
is returned. 'pages' was however not freed before returning error.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e59c4ab71bcb..13f555d62491 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -346,6 +346,8 @@ static int __init atomic_pool_init(void) (unsigned)pool->size / 1024); return 0; } + + kfree(pages); no_pages: kfree(bitmap); no_bitmap: |