summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/kern/kern_hhook.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/kern/kern_hhook.c')
-rw-r--r--freebsd/sys/kern/kern_hhook.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/freebsd/sys/kern/kern_hhook.c b/freebsd/sys/kern/kern_hhook.c
index 21239b24..2efdc533 100644
--- a/freebsd/sys/kern/kern_hhook.c
+++ b/freebsd/sys/kern/kern_hhook.c
@@ -103,7 +103,8 @@ hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd)
HHH_RLOCK(hhh, &rmpt);
STAILQ_FOREACH(hhk, &hhh->hhh_hooks, hhk_next) {
- if (hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) {
+ if (hhk->hhk_helper != NULL &&
+ hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) {
hdata = osd_get(OSD_KHELP, hosd, hhk->hhk_helper->h_id);
if (hdata == NULL)
continue;
@@ -511,7 +512,7 @@ hhook_vnet_uninit(const void *unused __unused)
/*
* When a vnet is created and being initialised, init the V_hhook_vhead_list.
*/
-VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST,
+VNET_SYSINIT(hhook_vnet_init, SI_SUB_INIT_IF, SI_ORDER_FIRST,
hhook_vnet_init, NULL);
/*
@@ -519,5 +520,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST,
* points to clean up on vnet tear down, but in case the KPI is misused,
* provide a function to clean up and free memory for a vnet being destroyed.
*/
-VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY,
+VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST,
hhook_vnet_uninit, NULL);