From: Liam R. Howlett Date: Tue, 12 Oct 2021 13:32:41 +0000 (-0400) Subject: maple_tree: Fix mast_split_data() issue with right node X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=77ef8fd33b23fbfac278f1fac278f42b66b483bb;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix mast_split_data() issue with right node Don't overwrite the maximum of the right node as it could be the most right node and be ULONG_MAX with a NULL. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9275c26c3490..55c6bc67ddeb 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3109,7 +3109,7 @@ static inline void mast_split_data(struct maple_subtree_state *mast, mab_mas_cp(mast->bn, 0, split, mast->l, true); mte_set_pivot(mast->r->node, 0, mast->r->max); - mab_mas_cp(mast->bn, split + 1, mast->bn->b_end, mast->r, true); + mab_mas_cp(mast->bn, split + 1, mast->bn->b_end, mast->r, false); mast->l->offset = mte_parent_slot(mas->node); mast->l->max = mast->bn->pivot[split]; mast->r->min = mast->l->max + 1;