btree: fix double-free in zfs_btree_remove_idx

We applied 03c0ee94b to fix two use-after-free cases, backporting 13f2b8fb9
from upstream. Unfortunately that patch seems to have been misapplied,
introducing a double-free in one of them. This commit fixes that.

Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
This commit is contained in:
Rob Norris 2023-05-23 10:51:29 +10:00 committed by Geoff Amey
parent 506f987972
commit f882884358
1 changed files with 1 additions and 1 deletions

View File

@ -1766,7 +1766,7 @@ zfs_btree_remove_idx(zfs_btree_t *tree, zfs_btree_index_t *where)
zfs_btree_poison_node_at(tree, keep_hdr, keep_hdr->bth_count);
rm_hdr->bth_count = 0;
zfs_btree_node_destroy(tree, rm_hdr);
/* Remove the emptied node from the parent. */
zfs_btree_remove_from_node(tree, parent, rm_hdr);
zfs_btree_node_destroy(tree, rm_hdr);