aboutsummaryrefslogtreecommitdiffstats
path: root/lib/genalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/genalloc.c')
-rw-r--r--lib/genalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/genalloc.c b/lib/genalloc.c
index 0a1139644d32..144fe6b1a03e 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -292,7 +292,7 @@ unsigned long gen_pool_alloc_algo(struct gen_pool *pool, size_t size,
292 struct gen_pool_chunk *chunk; 292 struct gen_pool_chunk *chunk;
293 unsigned long addr = 0; 293 unsigned long addr = 0;
294 int order = pool->min_alloc_order; 294 int order = pool->min_alloc_order;
295 int nbits, start_bit = 0, end_bit, remain; 295 int nbits, start_bit, end_bit, remain;
296 296
297#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 297#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
298 BUG_ON(in_nmi()); 298 BUG_ON(in_nmi());
@@ -307,6 +307,7 @@ unsigned long gen_pool_alloc_algo(struct gen_pool *pool, size_t size,
307 if (size > atomic_read(&chunk->avail)) 307 if (size > atomic_read(&chunk->avail))
308 continue; 308 continue;
309 309
310 start_bit = 0;
310 end_bit = chunk_size(chunk) >> order; 311 end_bit = chunk_size(chunk) >> order;
311retry: 312retry:
312 start_bit = algo(chunk->bits, end_bit, start_bit, 313 start_bit = algo(chunk->bits, end_bit, start_bit,