Skip to content

Commit

Permalink
idr: revert misallocation bug fix
Browse files Browse the repository at this point in the history
Commit 859ddf0 tried to fix
misallocation bug but broke full bit marking by not clearing
pa[idp->layers] and also is causing X failures due to lookup failure
in drm code.  The cause of the latter hasn't been found yet.  Revert
the fix for now.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
htejun authored and torvalds committed Feb 5, 2010
1 parent e9e70bc commit 6f14a66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
id = *starting_id;
restart:
p = idp->top;
l = p->layer;
l = idp->layers;
pa[l--] = NULL;
while (1) {
/*
* We run around this while until we reach the leaf node...
Expand All @@ -154,8 +155,8 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
oid = id;
id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;

/* did id go over the limit? */
if (id >= (1 << (idp->layers * IDR_BITS))) {
/* if already at the top layer, we need to grow */
if (!(p = pa[l])) {
*starting_id = id;
return IDR_NEED_TO_GROW;
}
Expand Down

0 comments on commit 6f14a66

Please sign in to comment.