From 921fd92c560b33b346b3c239c95be5dca6d0ad06 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 6 Oct 2020 15:21:36 -0400 Subject: [PATCH] maple_tree: Return false if _mas_walk is a ptr and mas->index != 0 Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index e3d2a10e330e..6b726bcc3a05 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3715,8 +3715,11 @@ static inline bool _mas_walk(struct ma_state *mas, unsigned long *range_min, return false; } - if (mas_is_ptr(mas)) - return true; + if (mas_is_ptr(mas)) { + if (!mas->index) + return true; + return false; + } mas_set_offset(mas, 0); return __mas_walk(mas, range_min, range_max); -- 2.50.1