Message ID | 20190508224727.11549-2-sstabellini@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/3] xen/arm: fix nr_pdxs calculation | expand |
diff --git a/xen/common/pdx.c b/xen/common/pdx.c index 50c21b6bf8..bb7e437049 100644 --- a/xen/common/pdx.c +++ b/xen/common/pdx.c @@ -83,8 +83,10 @@ void __init pfn_pdx_hole_setup(unsigned long mask) */ for ( j = MAX_ORDER-1; ; ) { - i = find_next_zero_bit(&mask, BITS_PER_LONG, j); - j = find_next_bit(&mask, BITS_PER_LONG, i); + i = find_next_zero_bit(&mask, BITS_PER_LONG, j + 1); + if ( i >= BITS_PER_LONG ) + break; + j = find_next_bit(&mask, BITS_PER_LONG, i + 1); if ( j >= BITS_PER_LONG ) break; if ( j - i > hole_shift )