git: 930edc25568a - stable/15 - if_vmx: fix panic during kldload

Eric van Gyzen <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7f15aa.35c50.41009f9f__36540.7781022199$1786713531$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by vangyzen:

URL: https://cgit.FreeBSD.org/src/commit/?id=930edc25568a09845e070a2d18c6df9cec0867c7

commit 930edc25568a09845e070a2d18c6df9cec0867c7
Author:     Eric van Gyzen <[email protected]>
AuthorDate: 2025-10-04 12:23:41 +0000
Commit:     Eric van Gyzen <[email protected]>
CommitDate: 2026-08-14 13:18:10 +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.
    
    PR:             294312
    Sponsored by:   Dell Inc.
    
    (cherry picked from commit 01b0690c495e1043a72cae9ee945f9f2c2adc216)
---
 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 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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.