diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1e617be77dfb..216f54177151 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5576,7 +5576,7 @@ void mas_destroy(struct ma_state *mas) mas_start(mas); mtree_range_walk(mas); - end = mas_data_end(mas) + 1; + end = mas->end + 1; if (end < mt_min_slot_count(mas->node) - 1) mas_destroy_rebalance(mas, end);