Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 2021 21:59:33 GMT
From:      Lutz Donnerhacke <donner@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 63312dd6d129 - stable/12 - netgraph/bridge: malloc without flags
Message-ID:  <202106162159.15GLxXUl049266@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by donner:

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

commit 63312dd6d12992d7e8c10bcd41389d5a25192f8f
Author:     Lutz Donnerhacke <donner@FreeBSD.org>
AuthorDate: 2021-06-13 22:00:35 +0000
Commit:     Lutz Donnerhacke <donner@FreeBSD.org>
CommitDate: 2021-06-16 21:58:59 +0000

    netgraph/bridge: malloc without flags
    
    During tests an assert was triggered and pointed to missing flags in
    the newlink function of ng_bridge(4).
    
    Reported by:    markj
    Reviewed by:    markj
    Differential Revision: https://reviews.freebsd.org/D30759
    
    (cherry picked from commit 4c3280e58727e900d4c217054fe655e3512380f1)
---
 sys/netgraph/ng_bridge.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c
index 5a8c1731aa3f..1a0840341020 100644
--- a/sys/netgraph/ng_bridge.c
+++ b/sys/netgraph/ng_bridge.c
@@ -395,9 +395,7 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name)
 	if(NG_PEER_NODE(hook) == node)
 	        return (ELOOP);
 
-	link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO);
-	if (link == NULL)
-		return (ENOMEM);
+	link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_WAITOK | M_ZERO);
 
 	link->stats.recvOctets = counter_u64_alloc(M_WAITOK);
 	link->stats.recvPackets = counter_u64_alloc(M_WAITOK);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106162159.15GLxXUl049266>