⬢ DragonFlyBSD Kernel Audit
DF-3347 / fix.diff
← back to finding ↓ download raw
--- a/sys/net/lagg/if_lagg.c
+++ b/sys/net/lagg/if_lagg.c
@@ -2081 lagg_lacp_attach
 	error = lacp_attach(sc);
 	if (error)
 		return (error);
 
 	SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
-		lacp_port_create(lp);
+		if (lacp_port_create(lp) != 0) {	/* DF-3347 */
+			LAGG_WUNLOCK(sc);
+			lagg_lacp_detach(sc);		/* unwind cleanly */
+			LAGG_WLOCK(sc);
+			return (ENOMEM);
+		}