From f573da1a0e37ad02ded0dd28fbb561f665844097 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Sat, 29 Mar 2008 22:53:58 +0000 Subject: [PATCH] There is no need to erase hook->hk_node before freing hook. --- sys/netgraph/ng_base.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 645caf4a51e..588f3d2d77a 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -964,10 +964,8 @@ ng_unref_hook(hook_p hook) } while (! atomic_cmpset_int(&hook->hk_refs, v, v - 1)); if (v == 1) { /* we were the last */ - if (_NG_HOOK_NODE(hook)) { /* it'll probably be ng_deadnode */ + if (_NG_HOOK_NODE(hook)) /* it'll probably be ng_deadnode */ _NG_NODE_UNREF((_NG_HOOK_NODE(hook))); - hook->hk_node = NULL; - } NG_FREE_HOOK(hook); } }