]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Remove check from mas_prev_entry() loop
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 22 Feb 2022 16:58:45 +0000 (11:58 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Mar 2022 18:19:14 +0000 (13:19 -0500)
Fix up the change outside the very unlikely loop end

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 41d1bcbdaa18d38b937210e95e9a8a18cf73ad74..0bd2953e1eb6cafc758e352e91b7546e33e1af42 100644 (file)
@@ -4811,7 +4811,7 @@ retry:
        while (likely(!mas_is_none(mas))) {
                entry = mas_prev_nentry(mas, min, mas->index);
                if (unlikely(mas->last < min))
-                       break;
+                       goto not_found;
 
                if (likely(entry))
                        return entry;
@@ -4821,10 +4821,11 @@ retry:
                        goto retry;
                }
 
-               if (!mas_is_none(mas))
-                       mas->offset++;
+               mas->offset++;
        }
 
+       mas->offset--;
+not_found:
        mas->index = mas->last = min;
        return NULL;
 }