[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <bb57bd68cf450bc3430bc072269041355d798b7f.1275739617.git.imre.deak@nokia.com>
Date: Sat, 5 Jun 2010 15:09:17 +0300
From: imre.deak@...ia.com
To: LKML <linux-kernel@...r.kernel.org>
Cc: Imre Deak <imre.deak@...ia.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Zygo Blaxell <zygo.blaxell@...dros.com>,
Tejun Heo <tj@...nel.org>,
Akinobu Mita <akinobu.mita@...il.com>
Subject: [PATCH] genalloc: fix allocation from end of pool
From: Imre Deak <imre.deak@...ia.com>
bitmap_find_next_zero_area requires the size of the bitmap, we instead
passed the last suitable position. This made it impossible to allocate
from the end of the pool.
Signed-off-by: Imre Deak <imre.deak@...ia.com>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Zygo Blaxell <zygo.blaxell@...dros.com>
CC: Tejun Heo <tj@...nel.org>
CC: Akinobu Mita <akinobu.mita@...il.com>
---
lib/genalloc.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib/genalloc.c b/lib/genalloc.c
index 736c3b0..1923f14 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -128,7 +128,6 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
end_bit = (chunk->end_addr - chunk->start_addr) >> order;
- end_bit -= nbits + 1;
spin_lock_irqsave(&chunk->lock, flags);
start_bit = bitmap_find_next_zero_area(chunk->bits, end_bit, 0,
--
1.7.1
--
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