aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2025-10-04 12:23:41 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2025-10-04 15:20:00 +0000
commit01b0690c495e1043a72cae9ee945f9f2c2adc216 (patch)
treebb6c188f012061de92ba76c4cb786c649575ef0b
parent64f8416afd4cd042b34e3e975f84fb3493397828 (diff)
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.
-rw-r--r--sys/dev/vmware/vmxnet3/if_vmx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c
index 62b5f313a137..1a314ca6660e 100644
--- a/sys/dev/vmware/vmxnet3/if_vmx.c
+++ b/sys/dev/vmware/vmxnet3/if_vmx.c
@@ -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);