]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: fix goto lables in ma_insert
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 1 Feb 2019 00:30:44 +0000 (19:30 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:39 +0000 (10:52 -0400)
Fix the order of goto labels and set the error correct if using exists.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index d012855a23220f3b2402af85c73db6965a8d647b..05db6c45c34a982ba606a9615bdf20101864c528 100644 (file)
@@ -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;
 }