Date: Mon, 14 Jun 2021 13:44:48 GMT From: Lutz Donnerhacke <donner@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4c3280e58727 - main - netgraph/bridge: malloc without flags Message-ID: <202106141344.15EDimTM026085@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=4c3280e58727e900d4c217054fe655e3512380f1 commit 4c3280e58727e900d4c217054fe655e3512380f1 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-06-13 22:00:35 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-06-14 13:41:46 +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 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30759 --- 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 f77012d42d1c..03d5125972d0 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?202106141344.15EDimTM026085>