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
internal
ablk_helper.h -rw-r--r-- 734 bytes
aead.h -rw-r--r-- 2.6 KB
aes.h -rw-r--r-- 1019 bytes
algapi.h -rw-r--r-- 10.9 KB
authenc.h -rw-r--r-- 845 bytes
b128ops.h -rw-r--r-- 2.4 KB
blowfish.h -rw-r--r-- 376 bytes
cast5.h -rw-r--r-- 551 bytes
cast6.h -rw-r--r-- 597 bytes
cast_common.h -rw-r--r-- 193 bytes
compress.h -rw-r--r-- 4.0 KB
cryptd.h -rw-r--r-- 1.8 KB
crypto_wq.h -rw-r--r-- 122 bytes
ctr.h -rw-r--r-- 524 bytes
des.h -rw-r--r-- 503 bytes
drbg.h -rw-r--r-- 8.9 KB
gf128mul.h -rw-r--r-- 8.0 KB
hash.h -rw-r--r-- 28.9 KB
hash_info.h -rw-r--r-- 1.1 KB
if_alg.h -rw-r--r-- 2.4 KB
lrw.h -rw-r--r-- 1.2 KB
mcryptd.h -rw-r--r-- 2.3 KB
md5.h -rw-r--r-- 288 bytes
null.h -rw-r--r-- 192 bytes
padlock.h -rw-r--r-- 649 bytes
pcrypt.h -rw-r--r-- 1.4 KB
pkcs7.h -rw-r--r-- 969 bytes
public_key.h -rw-r--r-- 2.7 KB
rng.h -rw-r--r-- 4.7 KB
scatterwalk.h -rw-r--r-- 3.0 KB
serpent.h -rw-r--r-- 673 bytes
sha.h -rw-r--r-- 2.7 KB
sha1_base.h -rw-r--r-- 2.5 KB
sha256_base.h -rw-r--r-- 3.0 KB
sha512_base.h -rw-r--r-- 3.2 KB
skcipher.h -rw-r--r-- 2.7 KB
twofish.h -rw-r--r-- 716 bytes
vmac.h -rw-r--r-- 2.1 KB
xts.h -rw-r--r-- 613 bytes

back to top