git: af298663e9ff - main - e6000sw: unlock the driver lock in the error path during attach

From: Adrian Chadd <adrian_at_FreeBSD.org>
Date: Sun, 27 Apr 2025 18:38:09 UTC
The branch main has been updated by adrian:

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

commit af298663e9ff77e3a03da10d89d89e73a69a9ea7
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-04-25 18:38:20 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-04-27 18:04:39 +0000

    e6000sw: unlock the driver lock in the error path during attach
    
    The driver sleep lock was being held during most of the error paths,
    and not unlocking it will panic the kernel during detach.  So, fix it.
    
    Differential Revision:  https://reviews.freebsd.org/D50029
    Reviewed by:    imp
---
 sys/dev/etherswitch/e6000sw/e6000sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c
index 59ac05d99ae3..85900cebc303 100644
--- a/sys/dev/etherswitch/e6000sw/e6000sw.c
+++ b/sys/dev/etherswitch/e6000sw/e6000sw.c
@@ -650,6 +650,7 @@ e6000sw_attach(device_t dev)
 	return (0);
 
 out_fail:
+	E6000SW_UNLOCK(sc);
 	e6000sw_detach(dev);
 
 	return (err);