]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: dma-api: fix off-by-one error in __dma_supported()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Mar 2015 16:41:35 +0000 (16:41 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Mar 2015 19:48:35 +0000 (19:48 +0000)
commit19dc4450453a24867e8b25c00981c4d002af243e
treed2e407a4d3d44d4078b3600dad26b2bb8f07f5aa
parentb7d65746744b343701de14ca433982a3229390be
ARM: dma-api: fix off-by-one error in __dma_supported()

When validating the mask against the amount of memory we have available
(so that we can trap 32-bit DMA addresses with >32-bits memory), we had
not taken account of the fact that max_pfn is the maximum PFN number
plus one that would be in the system.

There are several references in the code which bear this out:

mm/page_owner.c:
for (; pfn < max_pfn; pfn++) {
}

arch/x86/kernel/setup.c:
high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/dma-mapping.c