git: 31c2290fc109 - releng/14.5 - if_vmx: fix panic during kldload
Colin Percival <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a83b520.47f78.33f0d0a3__17148.5087297455$1787016508$gmane$org@gitrepo.freebsd.org> |
The branch releng/14.5 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=31c2290fc1098248600a444c85194943eb08ee9e commit 31c2290fc1098248600a444c85194943eb08ee9e Author: Eric van Gyzen <[email protected]> AuthorDate: 2025-10-04 12:23:41 +0000 Commit: Colin Percival <[email protected]> CommitDate: 2026-08-18 01:27:46 +0000 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. Approved by: re (cperciva) PR: 294312 Sponsored by: Dell Inc. (cherry picked from commit 01b0690c495e1043a72cae9ee945f9f2c2adc216) (cherry picked from commit 065396e09e41d6932ef726053bed97aed6e022e1) --- sys/dev/vmware/vmxnet3/if_vmx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c index fdcad0dd4bba..92aee7f44338 100644 --- a/sys/dev/vmware/vmxnet3/if_vmx.c +++ b/sys/dev/vmware/vmxnet3/if_vmx.c @@ -2055,7 +2055,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);