Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

idr: fix idr_remove()

The return inside the loop makes us free only a single layer.

Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Jim Houston <jim.houston@comcast.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Nadia Derbey and committed by
Linus Torvalds
af8e2a4c 7793bfcf

+1 -1
+1 -1
lib/idr.c
··· 385 385 while (idp->id_free_cnt >= IDR_FREE_MAX) { 386 386 p = alloc_layer(idp); 387 387 kmem_cache_free(idr_layer_cache, p); 388 - return; 389 388 } 389 + return; 390 390 } 391 391 EXPORT_SYMBOL(idr_remove); 392 392