]> git.neil.brown.name Git - history.git/commitdiff
Bit find operations return past the end on failure.
authorLinus Torvalds <torvalds@home.transmeta.com>
Sat, 9 Nov 2002 01:38:27 +0000 (17:38 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 9 Nov 2002 01:38:27 +0000 (17:38 -0800)
kernel/pid.c
kernel/sched.c

index 0005a8cc36cb51bac37816865eaaac54284aece2..ed6adbba677be9dba184667ade01d8de2bfdf213 100644 (file)
@@ -131,7 +131,7 @@ next_map:
         */
 scan_more:
        offset = find_next_zero_bit(map->page, BITS_PER_PAGE, offset);
-       if (offset == BITS_PER_PAGE)
+       if (offset >= BITS_PER_PAGE)
                goto next_map;
        if (test_and_set_bit(offset, map->page))
                goto scan_more;
index aa62ce0df85fe11633c2a6d8ec59292be61a9aaa..6821d73ff10b7e377a9ae872ccfb1d9fdb0f060f 100644 (file)
@@ -770,7 +770,7 @@ skip_bitmap:
                idx = sched_find_first_bit(array->bitmap);
        else
                idx = find_next_bit(array->bitmap, MAX_PRIO, idx);
-       if (idx == MAX_PRIO) {
+       if (idx >= MAX_PRIO) {
                if (array == busiest->expired) {
                        array = busiest->active;
                        goto new_array;