]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix mas_dead_node for a trivial tree
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 13 Oct 2019 03:21:36 +0000 (23:21 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 18:56:26 +0000 (14:56 -0400)
For a tree with no entries, or an entry only at 0, mas_dead_node()
can be called with a mas->node of NULL.  This node is, by definition,
not dead.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
lib/maple_tree.c

index 350551179c33be5453cf30b69d8eb9c9854680af..3283ce5cb3c946d68cb219af40fe879c2f52ff71 100644 (file)
@@ -3303,7 +3303,9 @@ static inline int mas_safe_slot(struct ma_state *mas, unsigned char *slot,
 
 static inline int mas_dead_node(struct ma_state *mas, unsigned long index)
 {
-       if (!mte_dead_node(mas->node))
+       if (!mas->node)
+               return 0;
+       if (!mt_dead_node(mas->node))
                return 0;
 
        mas->index = index;