lib/genalloc.c: remove unmatched write_lock() in gen_pool_destroy
authorZygo Blaxell <[email protected]>
Tue, 16 Jun 2009 22:33:57 +0000 (15:33 -0700)
committerLinus Torvalds <[email protected]>
Wed, 17 Jun 2009 02:47:53 +0000 (19:47 -0700)
There is a call to write_lock() in gen_pool_destroy which is not balanced
by any corresponding write_unlock().  This causes problems with preemption
because the preemption-disable counter is incremented in the write_lock()
call, but never decremented by any call to write_unlock().  This bug is
gen_pool_destroy, and one of them is non-x86 arch-specific code.

Signed-off-by: Zygo Blaxell <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Steve Wise <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/genalloc.c

index f6d276db2d58f97c80db2b0aececde84120893a9..eed2bdb865e76673bfe24834301de8406d9cfc88 100644 (file)
@@ -85,7 +85,6 @@ void gen_pool_destroy(struct gen_pool *pool)
        int bit, end_bit;
 
 
-       write_lock(&pool->lock);
        list_for_each_safe(_chunk, _next_chunk, &pool->chunks) {
                chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
                list_del(&chunk->next_chunk);