]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Return false if _mas_walk is a ptr and mas->index != 0
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 6 Oct 2020 19:21:36 +0000 (15:21 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:12:53 +0000 (15:12 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index e3d2a10e330e701cd51e746050bbe5eb1fdba9ae..6b726bcc3a059adf624e71d4a185d11e27cbc20e 100644 (file)
@@ -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);