git: dfcd04c4c811 - main - net/if_vlan.c: do not leak vlan sx slock in vlan_clone_dump_nl()

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 22 Feb 2026 20:52:20 UTC
The branch main has been updated by kib:

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

commit dfcd04c4c811096e5183a406d0f001a7c0ffa60a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-21 18:54:52 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-02-22 20:52:04 +0000

    net/if_vlan.c: do not leak vlan sx slock in vlan_clone_dump_nl()
    
    Reported by:    pho
    Reviewed by:    markj
    Fixes:  d4062b9f16e46f039f2b5b40dd35592b5dabf00c
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Differential revision:  https://reviews.freebsd.org/D55447
---
 sys/net/if_vlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index f74e3cb209fe..c254e2aa3107 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1345,6 +1345,7 @@ vlan_clone_dump_nl(struct ifnet *ifp, struct nl_writer *nw)
 
 	VLAN_SLOCK();
 	if (__predict_false((ifv = ifp->if_softc) == NULL)) {
+		VLAN_SUNLOCK();
 		/*
 		 * XXXGL: the interface already went through if_dead().  This
 		 * check to be removed when we got better interface removal.