]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix double free error.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 8 Mar 2019 18:53:10 +0000 (13:53 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:41 +0000 (10:52 -0400)
There was a double free which raced with the rcu free so it was not
detected all the time.

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

index 7a3970ea8cad948b407489732e170868ae06a721..cd3b099b5058d46d4003caba66576e72efbad90a 100644 (file)
@@ -1028,7 +1028,8 @@ static inline int ma_split(struct ma_state *mas, unsigned char slot)
        }
 
        // Free the full node.
-       mt_free(mt_to_node(full));
+       if (old_parent != full)
+               mt_free(mt_to_node(full));
        return split;
 }