Use M_WAITOK flag instead M_WAIT for malloc.

Suggested by:	glebius
MFC after:	1 week
This commit is contained in:
Andrey V. Elsukov 2011-04-18 09:10:27 +00:00
parent bc62b5cf6a
commit ffbfc0aacb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220767

View File

@ -165,7 +165,7 @@ ng_patch_constructor(node_p node)
{
priv_p privdata;
privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAIT | M_ZERO);
privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAITOK | M_ZERO);
NG_NODE_SET_PRIVATE(node, privdata);
privdata->in = NULL;
privdata->out = NULL;
@ -208,7 +208,8 @@ ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (privp->config == NULL)
break;
NG_MKRESPONSE(resp, msg,
NG_PATCH_CONF_SIZE(privp->config->count), M_WAIT);
NG_PATCH_CONF_SIZE(privp->config->count),
M_WAITOK);
bcopy(privp->config, resp->data,
NG_PATCH_CONF_SIZE(privp->config->count));
break;
@ -248,10 +249,10 @@ ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook)
if (error == 0) {
newconf = malloc(
NG_PATCH_CONF_SIZE(conf->count),
M_NETGRAPH, M_WAIT);
M_NETGRAPH, M_WAITOK);
newval = malloc(conf->count *
sizeof(union patch_val), M_NETGRAPH,
M_WAIT);
M_WAITOK);
for(i = 0; i < conf->count; i++) {
switch (conf->ops[i].length) {
case 1:
@ -288,7 +289,7 @@ ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook)
/* FALLTHROUGH */
case NGM_PATCH_GET_STATS:
NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats),
M_WAIT);
M_WAITOK);
bcopy(&(privp->stats), resp->data,
sizeof(struct ng_patch_stats));
if (clear == 0)