aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjiangxiaoming <jiangxiaoming@outlook.com>2021-12-30 08:52:38 +0000
committerDamjan Marion <dmarion@me.com>2022-01-01 20:38:50 +0000
commita3d8c2c21472c3088fb770d60d111fd5c55d9225 (patch)
tree808536f0ca6eb254ed8f28b804be7d6752fbff77 /src
parente3aeb38fa82b77ae84643f5140d9674056b6b5ca (diff)
vppinfra: fix bitmap can't get correct next clear index
when bitmap vec len is 1 and all the bits has been occupied, clib_bitmap_next_clear(ai, 63) will return result:65 which should be 64. It will lead to missing iteration for pool_foreach. Type: fix Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: Iadac7e6f6b4da357943c4c9d50bf22353c4a8408
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/bitmap.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vppinfra/bitmap.h b/src/vppinfra/bitmap.h
index 3c95bfb4b43..d9bdd0fac7d 100644
--- a/src/vppinfra/bitmap.h
+++ b/src/vppinfra/bitmap.h
@@ -742,8 +742,7 @@ clib_bitmap_next_clear (uword * ai, uword i)
return log2_first_set (t) + i0 * BITS (ai[0]);
}
- /* no clear bit left in bitmap, return bit just beyond bitmap */
- return (i0 * BITS (ai[0])) + 1;
+ return i0 * BITS (ai[0]);
}
return i;
}