]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Remove double free of full node.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 6 Dec 2018 21:42:40 +0000 (16:42 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 6 Dec 2018 21:42:40 +0000 (16:42 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 446819f102db537b60ea15fd07d66245a1c396c0..2fc3811d57e8a6938381c55a1811fb11a71a09e2 100644 (file)
@@ -475,15 +475,18 @@ void maple_link_node(struct maple_state *ms,
                rmn64->parent = fmn64->parent;
                /* Shift the data over */
                maple_shift_64(target, ms->slot_idx);
+               /* Overwrite the duplicate slot data with the new right node */
                target->slot[ms->slot_idx + 1] = ma_mk_node(rmn);
+               /* Overwrite the first pivot with the new value.  This is fine
+                * as the current slot has valid entries for this pivot */
                target->pivot[ms->slot_idx] = lmn64->pivot[3];
+               /* Set the first slot to the node with less pivots */
                target->slot[ms->slot_idx] = ma_mk_node(lmn);
        }
 
-       /* Orphan the full node */
+       /* Orphan & free the full node */
        fmn64->parent = full_mn;
        _maple_free_node(full_mn);
-       kfree(ma_get_alloc(ms));
 }
 /*
  * Private