[PATCH] arm64: add missing PAGE_ALIGN() to __dma_free()

Catalin Marinas catalin.marinas at arm.com
Wed Apr 29 08:23:41 PDT 2015


On Wed, Apr 29, 2015 at 11:09:18AM -0400, Dean Nelson wrote:
> __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.
> 
> Signed-off-by: Dean Nelson <dnelson at redhat.com>
> Cc: stable at vger.kernel.org

Thanks for posting this:

Acked-by: Catalin Marinas <catalin.marinas at arm.com>

I guess Will is picking it up for 4.1

-- 
Catalin



More information about the linux-arm-kernel mailing list