Revision 2cff98b99c469880ce830cbcde015b53b67e0a7b authored by Dean Nelson on 29 April 2015, 15:09:18 UTC, committed by Will Deacon on 29 April 2015, 16:39:39 UTC
__dma_alloc() does a PAGE_ALIGN() on the passed in size argument before
doing anything else. __dma_free() does not. And because it doesn't, it is
possible to leak memory should size not be an integer multiple of PAGE_SIZE.

The solution is to add a PAGE_ALIGN() to __dma_free() like is done in
__dma_alloc().

Additionally, this patch removes a redundant PAGE_ALIGN() from
__dma_alloc_coherent(), since __dma_alloc_coherent() can only be called
from __dma_alloc(), which already does a PAGE_ALIGN() before the call.

Cc: stable@vger.kernel.org
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 6829e27
History
File Mode Size
chips
devices
lpddr
maps
nand
onenand
spi-nor
tests
ubi
Kconfig -rw-r--r-- 11.6 KB
Makefile -rw-r--r-- 1.1 KB
afs.c -rw-r--r-- 6.3 KB
ar7part.c -rw-r--r-- 4.2 KB
bcm47xxpart.c -rw-r--r-- 8.5 KB
bcm63xxpart.c -rw-r--r-- 6.5 KB
cmdlinepart.c -rw-r--r-- 10.9 KB
ftl.c -rw-r--r-- 31.4 KB
inftlcore.c -rw-r--r-- 24.5 KB
inftlmount.c -rw-r--r-- 22.4 KB
mtd_blkdevs.c -rw-r--r-- 13.2 KB
mtdblock.c -rw-r--r-- 9.7 KB
mtdblock_ro.c -rw-r--r-- 2.5 KB
mtdchar.c -rw-r--r-- 25.5 KB
mtdconcat.c -rw-r--r-- 22.8 KB
mtdcore.c -rw-r--r-- 33.7 KB
mtdcore.h -rw-r--r-- 790 bytes
mtdoops.c -rw-r--r-- 11.8 KB
mtdpart.c -rw-r--r-- 22.1 KB
mtdsuper.c -rw-r--r-- 5.5 KB
mtdswap.c -rw-r--r-- 35.6 KB
nftlcore.c -rw-r--r-- 23.0 KB
nftlmount.c -rw-r--r-- 26.0 KB
ofpart.c -rw-r--r-- 4.4 KB
redboot.c -rw-r--r-- 8.4 KB
rfd_ftl.c -rw-r--r-- 18.3 KB
sm_ftl.c -rw-r--r-- 30.2 KB
sm_ftl.h -rw-r--r-- 2.5 KB
ssfdc.c -rw-r--r-- 11.3 KB

back to top