Commit 1fb418b2 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

Fix region sizing problem in dma_mark_declared_memory_occupied()

The current code reserves too few pages if addr isn't
page aligned and size just spans onto the last page.
Fix by increasing size by the addr misalignment amount.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 053b945d
......@@ -131,7 +131,7 @@ void *dma_mark_declared_memory_occupied(struct device *dev,
dma_addr_t device_addr, size_t size)
{
struct dma_coherent_mem *mem = dev->dma_mem;
int pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
int pos, err;
if (!mem)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment