Skip to content

Commit

Permalink
genalloc: fix allocation from end of pool
Browse files Browse the repository at this point in the history
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.

Fixes a regression introduced by 243797f
("genalloc: use bitmap_find_next_zero_area").

Signed-off-by: Imre Deak <[email protected]>
Cc: Zygo Blaxell <[email protected]>
Cc: Tejun Heo <[email protected]>
Acked-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Imre Deak authored and torvalds committed Jun 29, 2010
1 parent 984bc96 commit e621ba9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/genalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e621ba9

Please sign in to comment.