diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 82d3fa5d0..1dce3ebdb 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -957,15 +957,13 @@ bad: static void _stats_walk_next(const struct dm_stats *dms, int region, uint64_t *cur_r, uint64_t *cur_a) { - struct dm_stats_region *cur = NULL; + struct dm_stats_region *cur; int present; if (!dms || !dms->regions) return; - if (!(cur = &dms->regions[*cur_r])) - return; - + cur = dms->regions + *cur_r; present = _stats_region_present(cur); if (region && present)