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
appletalk
arcnet
bonding
caif
can
cris
dsa
ethernet
fddi
hamradio
hippi
hyperv
ieee802154
ipvlan
irda
phy
plip
ppp
slip
team
usb
vmxnet3
wan
wimax
wireless
xen-netback
Kconfig -rw-r--r-- 12.5 KB
LICENSE.SRC -rw-r--r-- 891 bytes
Makefile -rw-r--r-- 1.9 KB
Space.c -rw-r--r-- 4.1 KB
dummy.c -rw-r--r-- 5.4 KB
eql.c -rw-r--r-- 14.6 KB
ifb.c -rw-r--r-- 7.4 KB
loopback.c -rw-r--r-- 5.6 KB
macvlan.c -rw-r--r-- 39.5 KB
macvtap.c -rw-r--r-- 30.2 KB
mdio.c -rw-r--r-- 11.9 KB
mii.c -rw-r--r-- 12.3 KB
netconsole.c -rw-r--r-- 21.5 KB
nlmon.c -rw-r--r-- 3.9 KB
ntb_netdev.c -rw-r--r-- 9.9 KB
rionet.c -rw-r--r-- 15.7 KB
sb1000.c -rw-r--r-- 31.3 KB
sungem_phy.c -rw-r--r-- 29.7 KB
tun.c -rw-r--r-- 55.4 KB
veth.c -rw-r--r-- 11.8 KB
virtio_net.c -rw-r--r-- 51.9 KB
vxlan.c -rw-r--r-- 75.7 KB
xen-netfront.c -rw-r--r-- 53.4 KB

back to top