From: Liam R. Howlett Date: Fri, 1 Feb 2019 00:30:44 +0000 (-0500) Subject: maple_tree: fix goto lables in ma_insert X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cc810de61daf9f724314b624400c4b492f7c669c;p=users%2Fjedix%2Flinux-maple.git maple_tree: fix goto lables in ma_insert Fix the order of goto labels and set the error correct if using exists. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d012855a2322..05db6c45c34a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -957,10 +957,8 @@ void ma_insert(struct ma_state *mas, void *entry) slot = ma_get_slot(mas); src = &mt_to_node(mas->node)->mr64; if (leaf == true && slot != MAPLE_NODE_SLOTS) { - if (src->slot[slot]) { - mas_set_err(mas, -EEXIST); + if (src->slot[slot]) goto exists; - } } mas_coalesce(mas); @@ -974,8 +972,9 @@ void ma_insert(struct ma_state *mas, void *entry) return; -error: exists: + mas_set_err(mas, -EEXIST); +error: return; }