]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix __mas_next setting mas->node to NULL.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 22 Dec 2020 02:02:02 +0000 (21:02 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:33:41 +0000 (12:33 -0500)
This breaks prev/next beyond the limit which is useful to do.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index cf92a5fd4f8323b460c30c3b5249624d0ec61ce3..522f5fdfe5078fc777d9ac93a5ddb888123121fd 100644 (file)
@@ -3853,13 +3853,8 @@ retry:
                else
                        entry = mas_first_entry(mas, limit, &r_start);
 
-               if (unlikely((r_start > limit))) {
-                       *range_start = limit;
-                       mas->index = mas->last = limit;
-                       mas->offset = offset;
-                       mas->node = prev_node;
-                       return NULL;
-               }
+               if (unlikely((r_start > limit)))
+                       break;
 
                if (likely(entry)) {
                        if (unlikely(mas_dead_node(mas, index)))
@@ -3878,7 +3873,9 @@ next_node:
        }
 
        *range_start = limit;
-       mas->last = limit;
+       mas->last = mas->index = limit;
+       mas->offset = offset;
+       mas->node = prev_node;
        return NULL;
 }