forked from rubenslte/android_kernel_samsung_msm8226
Merge "idr: fix a subtle bug in idr_get_next()"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
f3a7a5f132
@@ -625,7 +625,14 @@ void *idr_get_next(struct idr *idp, int *nextidp)
|
||||
return p;
|
||||
}
|
||||
|
||||
id += 1 << n;
|
||||
/*
|
||||
* Proceed to the next layer at the current level. Unlike
|
||||
* idr_for_each(), @id isn't guaranteed to be aligned to
|
||||
* layer boundary at this point and adding 1 << n may
|
||||
* incorrectly skip IDs. Make sure we jump to the
|
||||
* beginning of the next layer using round_up().
|
||||
*/
|
||||
id = round_up(id + 1, 1 << n);
|
||||
while (n < fls(id)) {
|
||||
n += IDR_BITS;
|
||||
p = *--paa;
|
||||
|
||||
Reference in New Issue
Block a user