summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-06-02 00:34:14 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-06-02 00:34:14 +0000
commit3a0546e9dabef7fb59c2847df1ff1fc064e7a81d (patch)
tree82ff6de251621d5f77177a282869ce941e39f6c7
parent7d317bef5e4e3d84315a59133b1f8af8c14fcb0d (diff)
always clean up the heap in art_table_delete, even for the last at_refcnt
in the future a table may also be referenced by a cpu reading it with srp as well as the art rtable, so try and make sure it is always usable. ok mpi@
-rw-r--r--sys/net/art.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/art.c b/sys/net/art.c
index 6f54be86e2e..227aaa472c3 100644
--- a/sys/net/art.c
+++ b/sys/net/art.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: art.c,v 1.15 2016/06/01 06:19:06 dlg Exp $ */
+/* $OpenBSD: art.c,v 1.16 2016/06/02 00:34:13 dlg Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
@@ -490,10 +490,6 @@ art_table_delete(struct art_root *ar, struct art_table *at, int i,
KASSERT(prev == node);
#endif
- /* We are removing an entry from this table. */
- if (art_table_free(ar, at))
- return (node);
-
/* Get the next most specific route for the index `i'. */
if ((i >> 1) > 1)
next = at->at_heap[i >> 1].node;
@@ -512,6 +508,9 @@ art_table_delete(struct art_root *ar, struct art_table *at, int i,
else
at->at_heap[i].node = next;
+ /* We have removed an entry from this table. */
+ art_table_free(ar, at);
+
return (node);
}