From owner-dev-commits-src-all@freebsd.org Wed Jun 16 21:57:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C33E644995; Wed, 16 Jun 2021 21:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G4zYX3Rmnz3w3r; Wed, 16 Jun 2021 21:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EAE4233D8; Wed, 16 Jun 2021 21:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15GLv4Bf048998; Wed, 16 Jun 2021 21:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15GLv4Fu048997; Wed, 16 Jun 2021 21:57:04 GMT (envelope-from git) Date: Wed, 16 Jun 2021 21:57:04 GMT Message-Id: <202106162157.15GLv4Fu048997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: ad2c95130b4b - stable/13 - netgraph/bridge: malloc without flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad2c95130b4baceca8f314e4f1d966fcac8b96b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 21:57:04 -0000 The branch stable/13 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ad2c95130b4baceca8f314e4f1d966fcac8b96b9 commit ad2c95130b4baceca8f314e4f1d966fcac8b96b9 Author: Lutz Donnerhacke AuthorDate: 2021-06-13 22:00:35 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-06-16 21:55:35 +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 baedeb911e6d..3f3d8b3c406e 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);