aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-03-04 19:33:56 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2013-03-04 19:33:56 +0700
commitcdf733ed16cf85e9d89ed45f0eceb060f77955fd (patch)
treed6a234e722ad2d4c25b7c8bc3640b731525d8498 /lib
parent1736943179733a4629e0eaa773848bdeeaeefec1 (diff)
parente28c3f2b514b5581e15614f7cf976131092cf4b6 (diff)
downloadkernel_samsung_aries-cdf733ed16cf85e9d89ed45f0eceb060f77955fd.zip
kernel_samsung_aries-cdf733ed16cf85e9d89ed45f0eceb060f77955fd.tar.gz
kernel_samsung_aries-cdf733ed16cf85e9d89ed45f0eceb060f77955fd.tar.bz2
Merge 3.0.68
Conflicts: kernel/cgroup.c Change-Id: Ibae53bbb0eafbf4d273fce805eddce3db9ca48f9
Diffstat (limited to 'lib')
-rw-r--r--lib/idr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/idr.c b/lib/idr.c
index e15502e..b0540c6 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -621,7 +621,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;