git: 926905796749 - main - linuxkpi: Fix a lock leak in lkpi_sta_scan_to_auth()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 13 Dec 2024 20:30:27 UTC
The branch main has been updated by markj:

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

commit 926905796749750da6464b97ec4f8eec0882cc0e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-12-13 20:28:13 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-12-13 20:28:13 +0000

    linuxkpi: Fix a lock leak in lkpi_sta_scan_to_auth()
    
    PR:             283015
    Reviewed by:    bz
    MFC after:      1 week
    Fixes:          0936c648ad0e ("LinuxKPI: 802.11: update the ni/lsta reference cycle")
    Differential Revision:  https://reviews.freebsd.org/D47949
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 44c96909a002..edc3131286f5 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -1181,6 +1181,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
 		    lvif, vap, vap->iv_bss, lvif->lvif_bss,
 		    (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL,
 		    lvif->lvif_bss_synched);
+		LKPI_80211_LVIF_UNLOCK(lvif);
+		ieee80211_free_node(ni);	/* Error handling for the local ni. */
 		return (EBUSY);
 	}
 	LKPI_80211_LVIF_UNLOCK(lvif);