From e8c6b088703617a898b40f27b8370cad086ea059 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 13 Mar 2019 11:56:15 -0400 Subject: [PATCH] maple_tree: Fix range add to empty tree. When adding to an empty tree, use the encoded node to set the pivot. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8a53c362b561..f3d02e478122 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1211,7 +1211,7 @@ static inline void ma_root_expand(struct ma_state *ms, void *entry) /* Assign the old entry to slot 0, or set it to null. */ ma_set_rcu_slot(mn, 0, r_entry); if (!r_entry) - ma_set_pivot(mn, 0, ms->index - 1); + ma_set_pivot(ms->node, 0, ms->index - 1); _ma_insert(ms, entry, 1); if (mas_is_err(ms)) -- 2.50.1