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
Kconfig -rw-r--r-- 20.0 KB
Makefile -rw-r--r-- 3.8 KB
spi-adi-v3.c -rw-r--r-- 24.9 KB
spi-altera.c -rw-r--r-- 7.1 KB
spi-ath79.c -rw-r--r-- 7.1 KB
spi-atmel.c -rw-r--r-- 38.1 KB
spi-au1550.c -rw-r--r-- 25.7 KB
spi-bcm2835.c -rw-r--r-- 14.5 KB
spi-bcm53xx.c -rw-r--r-- 7.1 KB
spi-bcm53xx.h -rw-r--r-- 2.6 KB
spi-bcm63xx-hsspi.c -rw-r--r-- 12.3 KB
spi-bcm63xx.c -rw-r--r-- 11.6 KB
spi-bfin-sport.c -rw-r--r-- 22.8 KB
spi-bfin5xx.c -rw-r--r-- 39.9 KB
spi-bitbang-txrx.h -rw-r--r-- 3.2 KB
spi-bitbang.c -rw-r--r-- 12.1 KB
spi-butterfly.c -rw-r--r-- 8.2 KB
spi-cadence.c -rw-r--r-- 20.3 KB
spi-clps711x.c -rw-r--r-- 5.2 KB
spi-coldfire-qspi.c -rw-r--r-- 13.1 KB
spi-davinci.c -rw-r--r-- 28.4 KB
spi-dln2.c -rw-r--r-- 20.7 KB
spi-dw-mid.c -rw-r--r-- 7.9 KB
spi-dw-mmio.c -rw-r--r-- 3.2 KB
spi-dw-pci.c -rw-r--r-- 3.7 KB
spi-dw.c -rw-r--r-- 15.3 KB
spi-dw.h -rw-r--r-- 5.3 KB
spi-efm32.c -rw-r--r-- 11.8 KB
spi-ep93xx.c -rw-r--r-- 24.3 KB
spi-falcon.c -rw-r--r-- 10.5 KB
spi-fsl-cpm.c -rw-r--r-- 10.0 KB
spi-fsl-cpm.h -rw-r--r-- 1.6 KB
spi-fsl-dspi.c -rw-r--r-- 15.5 KB
spi-fsl-espi.c -rw-r--r-- 20.5 KB
spi-fsl-lib.c -rw-r--r-- 4.7 KB
spi-fsl-lib.h -rw-r--r-- 3.5 KB
spi-fsl-spi.c -rw-r--r-- 22.7 KB
spi-fsl-spi.h -rw-r--r-- 2.0 KB
spi-gpio.c -rw-r--r-- 14.7 KB
spi-img-spfi.c -rw-r--r-- 19.2 KB
spi-imx.c -rw-r--r-- 32.8 KB
spi-lm70llp.c -rw-r--r-- 8.9 KB
spi-meson-spifc.c -rw-r--r-- 11.2 KB
spi-mpc512x-psc.c -rw-r--r-- 15.5 KB
spi-mpc52xx-psc.c -rw-r--r-- 13.3 KB
spi-mpc52xx.c -rw-r--r-- 14.1 KB
spi-mxs.c -rw-r--r-- 14.2 KB
spi-nuc900.c -rw-r--r-- 8.9 KB
spi-oc-tiny.c -rw-r--r-- 8.7 KB
spi-octeon.c -rw-r--r-- 6.2 KB
spi-omap-100k.c -rw-r--r-- 12.7 KB
spi-omap-uwire.c -rw-r--r-- 12.5 KB
spi-omap2-mcspi.c -rw-r--r-- 38.0 KB
spi-orion.c -rw-r--r-- 12.8 KB
spi-pl022.c -rw-r--r-- 68.2 KB
spi-ppc4xx.c -rw-r--r-- 13.6 KB
spi-pxa2xx-dma.c -rw-r--r-- 8.8 KB
spi-pxa2xx-pci.c -rw-r--r-- 5.2 KB
spi-pxa2xx-pxadma.c -rw-r--r-- 13.3 KB
spi-pxa2xx.c -rw-r--r-- 41.1 KB
spi-pxa2xx.h -rw-r--r-- 5.5 KB
spi-qup.c -rw-r--r-- 26.5 KB
spi-rockchip.c -rw-r--r-- 21.0 KB
spi-rspi.c -rw-r--r-- 34.3 KB
spi-s3c24xx-fiq.S -rw-r--r-- 2.9 KB
spi-s3c24xx-fiq.h -rw-r--r-- 671 bytes
spi-s3c24xx.c -rw-r--r-- 15.2 KB
spi-s3c64xx.c -rw-r--r-- 37.5 KB
spi-sc18is602.c -rw-r--r-- 7.7 KB
spi-sh-hspi.c -rw-r--r-- 6.5 KB
spi-sh-msiof.c -rw-r--r-- 34.5 KB
spi-sh-sci.c -rw-r--r-- 4.7 KB
spi-sh.c -rw-r--r-- 11.9 KB
spi-sirf.c -rw-r--r-- 23.7 KB
spi-st-ssc4.c -rw-r--r-- 11.5 KB
spi-sun4i.c -rw-r--r-- 11.4 KB
spi-sun6i.c -rw-r--r-- 11.8 KB
spi-tegra114.c -rw-r--r-- 33.1 KB
spi-tegra20-sflash.c -rw-r--r-- 16.3 KB
spi-tegra20-slink.c -rw-r--r-- 33.6 KB
spi-ti-qspi.c -rw-r--r-- 14.0 KB
spi-tle62x0.c -rw-r--r-- 7.2 KB
spi-topcliff-pch.c -rw-r--r-- 46.6 KB
spi-txx9.c -rw-r--r-- 11.1 KB
spi-xcomm.c -rw-r--r-- 5.8 KB
spi-xilinx.c -rw-r--r-- 13.7 KB
spi-xtensa-xtfpga.c -rw-r--r-- 4.0 KB
spi.c -rw-r--r-- 62.7 KB
spidev.c -rw-r--r-- 21.4 KB

back to top