aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-03-05 12:41:46 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-03-06 02:49:07 +0000
commit551c4cb74a807ceae55288bf273f5cfeb37c7c91 (patch)
tree0daf34e7855b9dae25993bed6dfd45ca1cd00cb2
parent272ea451199462dffd55dd580532eb28ddc92174 (diff)
iwlwifi: mld: move module_init() to SI_ORDER_SECOND
In FreeBSD the iwlwifi driver is a single kernel module. As for iwlwifi/mvm we need to make sure the common "iwlwifi drv" code is initialized before trying to register the mld sub-driver in order for lists, etc. in the registration code to be initialized. We do this by using an extended (FreeBSD specific) version of module_init which overrides the order parameter of the SYSINIT. Otherwise we can randomly (depending on SYSINIT run order) run into a NULL pointer deref panic. Sponsored by: The FreeBSD Foundation PR: 291120 MFC after: 3 days
-rw-r--r--sys/contrib/dev/iwlwifi/mld/mld.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/contrib/dev/iwlwifi/mld/mld.c b/sys/contrib/dev/iwlwifi/mld/mld.c
index 7b46ccc306ab..8075b886ddbf 100644
--- a/sys/contrib/dev/iwlwifi/mld/mld.c
+++ b/sys/contrib/dev/iwlwifi/mld/mld.c
@@ -44,7 +44,11 @@ static int __init iwl_mld_init(void)
return ret;
}
+#if defined(__linux__)
module_init(iwl_mld_init);
+#elif defined(__FreeBSD__)
+module_init_order(iwl_mld_init, SI_ORDER_SECOND);
+#endif
static void __exit iwl_mld_exit(void)
{