From ee5fc18d8a840a59e7ce8470a1f21d38e910fbb9 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 17 Jan 2012 18:10:25 +0000 Subject: The newhook method can be called in ISR context at certain circumstances, so better use M_NOWAIT in it. --- sys/netgraph/ng_tag.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_tag.c b/sys/netgraph/ng_tag.c index 150a0f2..22d45a3 100644 --- a/sys/netgraph/ng_tag.c +++ b/sys/netgraph/ng_tag.c @@ -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); /* -- cgit v1.1