From: Liam R. Howlett Date: Tue, 4 Aug 2020 14:28:59 +0000 (-0400) Subject: maple_tree: Clean up splitting name and add exception to validate X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b644a5298e94544d008bae7491a03add1a7125ed;p=users%2Fjedix%2Flinux-maple.git maple_tree: Clean up splitting name and add exception to validate Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1bf8b7a8d6448..46864639a091b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1487,7 +1487,7 @@ static inline int mab_no_null_split(struct maple_big_node *b_node, /* If the split is less than the max slot && the right side will * still be sufficient, then increment the split on NULL. */ - if ((split < mt_slots[b_node->type] - 1) && + if ((split < slot_cnt - 1) && (b_node->b_end - split) < (mt_min_slots[b_node->type])) split++; else