if_vmx: fix panic during kldload

Just like vmxnet3_intr_disable_all, iflib may invoke this routine
before vmxnet3_attach_post() has run, which is before the top-level
shared data area is initialized and the device made aware of it.

MFC after:	1 week
Sponsored by:	Dell Inc.
This commit is contained in:
Eric van Gyzen
2025-10-04 08:23:41 -04:00
parent 64f8416afd
commit 01b0690c49
+6 -1
View File
@@ -2056,7 +2056,12 @@ vmxnet3_update_admin_status(if_ctx_t ctx)
struct vmxnet3_softc *sc;
sc = iflib_get_softc(ctx);
if (sc->vmx_ds->event != 0)
/*
* iflib may invoke this routine before vmxnet3_attach_post() has
* run, which is before the top level shared data area is
* initialized and the device made aware of it.
*/
if (sc->vmx_ds != NULL && sc->vmx_ds->event != 0)
vmxnet3_evintr(sc);
vmxnet3_refresh_host_stats(sc);