Commit 61599636 authored by Linus Torvalds's avatar Linus Torvalds

Bit find operations return past the end on failure.

parent c0454a9f
...@@ -131,7 +131,7 @@ int alloc_pidmap(void) ...@@ -131,7 +131,7 @@ int alloc_pidmap(void)
*/ */
scan_more: scan_more:
offset = find_next_zero_bit(map->page, BITS_PER_PAGE, offset); offset = find_next_zero_bit(map->page, BITS_PER_PAGE, offset);
if (offset == BITS_PER_PAGE) if (offset >= BITS_PER_PAGE)
goto next_map; goto next_map;
if (test_and_set_bit(offset, map->page)) if (test_and_set_bit(offset, map->page))
goto scan_more; goto scan_more;
......
...@@ -770,7 +770,7 @@ static void load_balance(runqueue_t *this_rq, int idle) ...@@ -770,7 +770,7 @@ static void load_balance(runqueue_t *this_rq, int idle)
idx = sched_find_first_bit(array->bitmap); idx = sched_find_first_bit(array->bitmap);
else else
idx = find_next_bit(array->bitmap, MAX_PRIO, idx); idx = find_next_bit(array->bitmap, MAX_PRIO, idx);
if (idx == MAX_PRIO) { if (idx >= MAX_PRIO) {
if (array == busiest->expired) { if (array == busiest->expired) {
array = busiest->active; array = busiest->active;
goto new_array; goto new_array;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment