]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
lib/idr.c: Fix bug introduced by RCU fix
authorManfred Spraul <manfred@colorfullife.com>
Wed, 10 Dec 2008 17:17:06 +0000 (18:17 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2008 21:34:33 +0000 (13:34 -0800)
commit711a49a07f84f914aac26a52143f6e7526571143
tree3ca4f774f868c1884bc6dc416ea68aa7b8666ef7
parentc7f8d6f6b5d121e5f7408119661ca29fc4661c10
lib/idr.c: Fix bug introduced by RCU fix

The last patch to lib/idr.c caused a bug if idr_get_new_above() was
called on an empty idr.

Usually, nodes stay on the same layer.  New layers are added to the top
of the tree.

The exception is idr_get_new_above() on an empty tree: In this case, the
new root node is first added on layer 0, then moved upwards.  p->layer
was not updated.

As usual: You shall never rely on the source code comments, they will
only mislead you.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/idr.c