[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1232488507.6794.8.camel@localhost.localdomain>
Date: Tue, 20 Jan 2009 21:55:07 +0000
From: Adrian McMenamin <adrian@...golddream.dyndns.info>
To: Adrian McMenamin <lkmladrian@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Paul Mundt <lethal@...ux-sh.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-sh <linux-sh@...r.kernel.org>, penberg@...helsinki.fi,
dbaryshkov@...il.com, penguin-kernel@...ove.sakura.ne.jp
Subject: Re: [PATCH] dma: fix up broken comparison in
dma_alloc_from_coherent
On Tue, 2009-01-20 at 21:48 +0000, Adrian McMenamin wrote:
> Currently this code compares a size in bytes with a size in pages.
> This patch makes both sides of the comparison bytes.
Apologies, here it is without the line wrap.
Currently this comparison is made between bytes and pages. This patch
ensures it is bytes on both side of the comparison.
Signed-off-by: Adrian McMenamin <adrian@...en.demon.co.uk>
---
--- a/kernel/dma-coherent.c
+++ b/kernel/dma-coherent.c
@@ -118,7 +118,7 @@ int dma_alloc_from_coherent(struct device *dev, ssize_t size,
mem = dev->dma_mem;
if (!mem)
return 0;
- if (unlikely(size > mem->size))
+ if (unlikely(size > mem->size << PAGE_SHIFT))
return 0;
pageno = bitmap_find_free_region(mem->bitmap, mem->size, order);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists