[PATCH 3/7] maple_tree: check mid_split only may have

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We only may set mid_split in the else clause, let's move the check in
it.

Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
CC: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
CC: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
CC: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
---
 lib/maple_tree.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 2a00441130ee..f5606b4d0dba 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2381,10 +2381,11 @@ static inline unsigned char mas_mab_to_node(struct ma_state *mas,
 	} else {
 		split = mab_calc_split(mas, b_node, mid_split);
 		*right = mas_new_ma_node(mas, b_node);
+
+		if (*mid_split)
+			*middle = mas_new_ma_node(mas, b_node);
 	}
 
-	if (*mid_split)
-		*middle = mas_new_ma_node(mas, b_node);
 
 	return split;
 
-- 
2.34.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux