From: Liam R. Howlett Date: Tue, 22 Feb 2022 16:58:45 +0000 (-0500) Subject: maple_tree: Remove check from mas_prev_entry() loop X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c7391ac1a11b1a49ea06593b8618084df3fcefd0;p=users%2Fjedix%2Flinux-maple.git maple_tree: Remove check from mas_prev_entry() loop Fix up the change outside the very unlikely loop end Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 41d1bcbdaa18..0bd2953e1eb6 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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; }