If we delete entries in the vector_foreach_slot loop, the loop index may underflow. It's not a big issue because we re-increment it in the next iteration and use a cast to int in the loop end condition, but it's cleaner to use an int here. Found by coverity. Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- multipathd/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 13ed6d0..be35038 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -762,7 +762,7 @@ coalesce_maps(struct vectors *vecs, vector nmpv) { struct multipath * ompp; vector ompv = vecs->mpvec; - unsigned int i, reassign_maps; + int i, reassign_maps; struct config *conf; conf = get_multipath_config(); @@ -1748,7 +1748,7 @@ static int map_discovery (struct vectors * vecs) { struct multipath * mpp; - unsigned int i; + int i; if (dm_get_maps(vecs->mpvec)) return 1; @@ -1970,7 +1970,7 @@ static void mpvec_garbage_collector (struct vectors * vecs) { struct multipath * mpp; - unsigned int i; + int i; if (!vecs->mpvec) return; @@ -2014,7 +2014,7 @@ static void missing_uev_wait_tick(struct vectors *vecs) { struct multipath * mpp; - unsigned int i; + int i; int timed_out = 0; vector_foreach_slot (vecs->mpvec, mpp, i) { @@ -2039,7 +2039,7 @@ static void ghost_delay_tick(struct vectors *vecs) { struct multipath * mpp; - unsigned int i; + int i; vector_foreach_slot (vecs->mpvec, mpp, i) { if (mpp->ghost_delay_tick <= 0) -- 2.45.2