summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_hhook.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c
index 1e34044..4f5d144 100644
--- a/sys/kern/kern_hhook.c
+++ b/sys/kern/kern_hhook.c
@@ -264,9 +264,10 @@ hhook_head_register(int32_t hhook_type, int32_t hhook_id, struct hhook_head **hh
STAILQ_INIT(&tmphhh->hhh_hooks);
HHH_LOCK_INIT(tmphhh);
- if (hhh != NULL)
+ if (hhh != NULL) {
refcount_init(&tmphhh->hhh_refcount, 1);
- else
+ *hhh = tmphhh;
+ } else
refcount_init(&tmphhh->hhh_refcount, 0);
if (flags & HHOOK_HEADISINVNET) {
@@ -278,8 +279,6 @@ hhook_head_register(int32_t hhook_type, int32_t hhook_id, struct hhook_head **hh
/* XXXLAS: Add tmphhh to the non-virtualised list. */
}
- *hhh = tmphhh;
-
return (0);
}
OpenPOWER on IntegriCloud