浏览代码

ARM: Fix DMA coherent allocator alignment

An out by one bug meant that the DMA coherent allocator was aligning
to one more bit than it should, causing it to run out of available
memory quicker.  Fix this.

Reported-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 14 年之前
父节点
当前提交
c947f69fff
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/mm/dma-mapping.c

+ 1 - 1
arch/arm/mm/dma-mapping.c

@@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
 	 * fragmentation of the DMA space, and also prevents allocations
 	 * smaller than a section from crossing a section boundary.
 	 */
-	bit = fls(size - 1) + 1;
+	bit = fls(size - 1);
 	if (bit > SECTION_SHIFT)
 		bit = SECTION_SHIFT;
 	align = 1 << bit;