1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: stats uses overflowing counter

Here we need to annotate counter as it starts with UINT64_MAX
and overflows to 0 is expected.
This commit is contained in:
Zdenek Kabelac 2024-05-08 09:36:39 +02:00
parent 8168b5e71d
commit 4dda6d1555

View File

@ -1444,8 +1444,9 @@ static void _stats_walk_next_present(const struct dm_stats *dms,
}
/* advance to next present, non-skipped region or end */
while ((*cur_r < UINT64_MAX) &&
++(*cur_r) <= dms->max_region) {
/* count can start as UINT64_MAX, probably rework to use post++ */
/* coverity[overflow_const] overflow is expected here */
while (++(*cur_r) <= dms->max_region) {
cur = &dms->regions[*cur_r];
if (!_stats_region_present(cur))
continue;