linux/arch/arm64
Dean Nelson 0df938e720 arm64: add missing PAGE_ALIGN() to __dma_free()
commit 2cff98b99c upstream.

__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.

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>
[ luis: backported to 3.16: based on Dean's 3.19 backport ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-05-28 10:53:16 +01:00
..
boot arm64: dts: Add more serial port nodes in APM X-Gene device tree 2014-06-18 12:41:55 +01:00
configs arm64: defconfig update for LTP 2014-06-18 12:40:52 +01:00
crypto crypto: prefix module autoloading with "crypto-" 2015-02-04 10:57:48 +00:00
include arm64: KVM: Do not use pgd_index to index stage-2 pgd 2015-05-20 13:25:54 +01:00
kernel arm64: head.S: ensure visibility of page tables 2015-05-06 11:33:01 +01:00
kvm arm64: KVM: Fix HCR setting for 32bit guests 2015-05-20 13:25:53 +01:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-27 11:21:47 +00:00
mm arm64: add missing PAGE_ALIGN() to __dma_free() 2015-05-28 10:53:16 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig locking/mutex: Disable optimistic spinning on some architectures 2014-07-16 14:57:07 +02:00
Kconfig.debug arm64: remove arch specific earlyprintk 2014-04-24 16:32:27 -07:00
Makefile arm64/crypto: SHA-1 using ARMv8 Crypto Extensions 2014-05-14 10:03:17 -07:00