From: Liam R. Howlett Date: Tue, 6 Oct 2020 19:21:36 +0000 (-0400) Subject: maple_tree: Return false if _mas_walk is a ptr and mas->index != 0 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7e74abb102c09054a92556d04f1105eb63b206e3;p=users%2Fjedix%2Flinux-maple.git maple_tree: Return false if _mas_walk is a ptr and mas->index != 0 Signed-off-by: Liam R. Howlett --- 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);