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
amcc
caam
ccp
nx
qat
qce
ux500
vmx
Kconfig -rw-r--r-- 13.2 KB
Makefile -rw-r--r-- 1.3 KB
atmel-aes-regs.h -rw-r--r-- 2.0 KB
atmel-aes.c -rw-r--r-- 35.4 KB
atmel-sha-regs.h -rw-r--r-- 1.4 KB
atmel-sha.c -rw-r--r-- 36.4 KB
atmel-tdes-regs.h -rw-r--r-- 2.6 KB
atmel-tdes.c -rw-r--r-- 37.9 KB
bfin_crc.c -rw-r--r-- 18.8 KB
bfin_crc.h -rw-r--r-- 3.8 KB
geode-aes.c -rw-r--r-- 13.5 KB
geode-aes.h -rw-r--r-- 1.5 KB
hifn_795x.c -rw-r--r-- 76.7 KB
img-hash.c -rw-r--r-- 24.9 KB
ixp4xx_crypto.c -rw-r--r-- 36.6 KB
mv_cesa.c -rw-r--r-- 28.8 KB
mv_cesa.h -rw-r--r-- 3.9 KB
mxs-dcp.c -rw-r--r-- 26.5 KB
n2_asm.S -rw-r--r-- 1.7 KB
n2_core.c -rw-r--r-- 52.3 KB
n2_core.h -rw-r--r-- 6.1 KB
omap-aes.c -rw-r--r-- 30.8 KB
omap-des.c -rw-r--r-- 28.7 KB
omap-sham.c -rw-r--r-- 50.3 KB
padlock-aes.c -rw-r--r-- 15.0 KB
padlock-sha.c -rw-r--r-- 15.9 KB
picoxcell_crypto.c -rw-r--r-- 52.6 KB
picoxcell_crypto_regs.h -rw-r--r-- 5.1 KB
s5p-sss.c -rw-r--r-- 19.4 KB
sahara.c -rw-r--r-- 42.8 KB
talitos.c -rw-r--r-- 78.8 KB
talitos.h -rw-r--r-- 13.5 KB

back to top