diff options
author | glebius <glebius@FreeBSD.org> | 2012-01-17 18:10:25 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-01-17 18:10:25 +0000 |
commit | ee5fc18d8a840a59e7ce8470a1f21d38e910fbb9 (patch) | |
tree | 7ffbb4d7b2847950df92c7cdadf3578b5231df64 /sys/netgraph | |
parent | 69f3e63a09d0bf9cf5040a94480ab69a27962f72 (diff) | |
download | FreeBSD-src-ee5fc18d8a840a59e7ce8470a1f21d38e910fbb9.zip FreeBSD-src-ee5fc18d8a840a59e7ce8470a1f21d38e910fbb9.tar.gz |
The newhook method can be called in ISR context at
certain circumstances, so better use M_NOWAIT in it.
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_tag.c | 5 |
1 files 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); /* |