From: Liam R. Howlett Date: Thu, 3 Mar 2022 03:36:59 +0000 (-0500) Subject: maple_tree: Fix extend_null overflow X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ed96dc9718ad06cbe3a05a3879ea8ab13606d58b;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix extend_null overflow Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a53dc391f055..f1fdb441ead7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4113,6 +4113,7 @@ static inline void mas_wr_extend_null(struct ma_wr_state *wr_mas) /* Check next slot(s) if we are overwriting the end */ if ((mas->last == wr_mas->end_piv) && + (wr_mas->node_end != wr_mas->offset_end) && !wr_mas->slots[wr_mas->offset_end + 1]) { wr_mas->offset_end++; if (wr_mas->offset_end == wr_mas->node_end)