Skip to content

Commit 46cd934

Browse files
committed
veb(4): Fix refcnt leak
pointed out by bluhm with tweaks from mvs ok bluhm, mvs
1 parent 9d0c2de commit 46cd934

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sys/net/if_veb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: if_veb.c,v 1.41 2025/07/07 02:28:50 jsg Exp $ */
1+
/* $OpenBSD: if_veb.c,v 1.42 2025/08/02 10:19:37 jan Exp $ */
22

33
/*
44
* Copyright (c) 2021 David Gwynne <[email protected]>
@@ -1028,7 +1028,7 @@ veb_broadcast(struct veb_softc *sc, struct veb_port *rp, struct mbuf *m0,
10281028
continue;
10291029

10301030
if ((m0 = veb_offload(ifp, ifp0, m0)) == NULL)
1031-
goto done;
1031+
goto rele;
10321032

10331033
m = m_dup_pkt(m0, max_linkhdr + ETHER_ALIGN, M_NOWAIT);
10341034
if (m == NULL) {
@@ -1038,6 +1038,7 @@ veb_broadcast(struct veb_softc *sc, struct veb_port *rp, struct mbuf *m0,
10381038

10391039
(*tp->p_enqueue)(ifp0, m); /* XXX count error */
10401040
}
1041+
rele:
10411042
refcnt_rele_wake(&pm->m_refs);
10421043

10431044
done:

0 commit comments

Comments
 (0)