From 6c78a88c3bb5f7c87b56f79915289532c9997f86 Mon Sep 17 00:00:00 2001 From: glebius Date: Mon, 18 Apr 2011 09:12:27 +0000 Subject: Node constructor methods are supposed to be called in syscall context always. Convert nodes to consistently use M_WAITOK flag for memory allocation. Reviewed by: julian --- sys/netgraph/netflow/ng_netflow.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/netgraph/netflow/ng_netflow.c') diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c index 53d0d6f..74036fa 100644 --- a/sys/netgraph/netflow/ng_netflow.c +++ b/sys/netgraph/netflow/ng_netflow.c @@ -223,10 +223,7 @@ ng_netflow_constructor(node_p node) int error = 0, i; /* Initialize private data */ - priv = malloc(sizeof(*priv), M_NETGRAPH, M_NOWAIT); - if (priv == NULL) - return (ENOMEM); - bzero(priv, sizeof(*priv)); + priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO); /* Make node and its data point at each other */ NG_NODE_SET_PRIVATE(node, priv); -- cgit v1.1