From c7391ac1a11b1a49ea06593b8618084df3fcefd0 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 22 Feb 2022 11:58:45 -0500 Subject: [PATCH] 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 --- lib/maple_tree.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.50.1