freebsd_network: NULL-check if_init before calling.

All FreeBSD drivers set it; not all OpenBSD drivers do.
This commit is contained in:
Augustin Cavalier 2023-01-30 21:58:24 -05:00
parent 0ab42081b5
commit 78eb4676ab

View File

@ -51,7 +51,8 @@ compat_open(const char *name, uint32 flags, void **cookie)
IFF_LOCKGIANT(ifp);
ifp->if_init(ifp->if_softc);
if (ifp->if_init != NULL)
ifp->if_init(ifp->if_softc);
if (!HAIKU_DRIVER_REQUIRES(FBSD_WLAN_FEATURE)) {
ifp->if_flags &= ~IFF_UP;