summaryrefslogtreecommitdiffstats
path: root/kernel/lib/genalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lib/genalloc.c')
-rw-r--r--kernel/lib/genalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/lib/genalloc.c b/kernel/lib/genalloc.c
index 116a166b0..27aa9c629 100644
--- a/kernel/lib/genalloc.c
+++ b/kernel/lib/genalloc.c
@@ -273,7 +273,7 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
struct gen_pool_chunk *chunk;
unsigned long addr = 0;
int order = pool->min_alloc_order;
- int nbits, start_bit = 0, end_bit, remain;
+ int nbits, start_bit, end_bit, remain;
#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
BUG_ON(in_nmi());
@@ -288,6 +288,7 @@ unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
if (size > atomic_read(&chunk->avail))
continue;
+ start_bit = 0;
end_bit = chunk_size(chunk) >> order;
retry:
start_bit = pool->algo(chunk->bits, end_bit, start_bit, nbits,