The newhook method can be called in ISR context at

certain circumstances, so better use M_NOWAIT in it.
This commit is contained in:
glebius 2012-01-17 18:10:25 +00:00
parent 69f3e63a09
commit ee5fc18d8a

View File

@ -303,8 +303,9 @@ ng_tag_newhook(node_p node, hook_p hook, const char *name)
int error;
/* Create hook private structure. */
hip = malloc(sizeof(*hip), M_NETGRAPH_TAG, M_WAITOK | M_ZERO);
/* M_WAITOK can't return NULL. */
hip = malloc(sizeof(*hip), M_NETGRAPH_TAG, M_NOWAIT | M_ZERO);
if (hip == NULL)
return (ENOMEM);
NG_HOOK_SET_PRIVATE(hook, hip);
/*