diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 75fd119f8224..797583d9278b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4542,6 +4542,9 @@ static inline void *mas_next_nentry(struct ma_state *mas, } pivots = ma_pivots(node, type); + if (!pivots) + return NULL; + slots = ma_slots(node, type); mas->index = mas_safe_min(mas, pivots, mas->offset); if (ma_dead_node(node))