aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_pctrie.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
index b461ffa3c5be..a7b487166054 100644
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -304,7 +304,8 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val,
if (pctrie_isleaf(node)) {
if (node == PCTRIE_NULL) {
if (parent == NULL)
- ptree->pt_root = pctrie_toleaf(val);
+ pctrie_root_store(ptree,
+ pctrie_toleaf(val), PCTRIE_LOCKED);
else
pctrie_addnode(parent, index,
pctrie_toleaf(val), PCTRIE_LOCKED);
@@ -1242,7 +1243,8 @@ pctrie_replace(struct pctrie *ptree, uint64_t *newval)
if (pctrie_isleaf(node)) {
if ((m = pctrie_toval(node)) != NULL && *m == index) {
if (parent == NULL)
- ptree->pt_root = leaf;
+ pctrie_root_store(ptree,
+ leaf, PCTRIE_LOCKED);
else
pctrie_node_store(
&parent->pn_child[slot], leaf,