svn commit: r230272 - head/sys/netgraph
Gleb Smirnoff
glebius at FreeBSD.org
Tue Jan 17 18:10:25 UTC 2012
Author: glebius
Date: Tue Jan 17 18:10:25 2012
New Revision: 230272
URL: http://svn.freebsd.org/changeset/base/230272
Log:
The newhook method can be called in ISR context at
certain circumstances, so better use M_NOWAIT in it.
Modified:
head/sys/netgraph/ng_tag.c
Modified: head/sys/netgraph/ng_tag.c
==============================================================================
--- head/sys/netgraph/ng_tag.c Tue Jan 17 18:05:13 2012 (r230271)
+++ head/sys/netgraph/ng_tag.c Tue Jan 17 18:10:25 2012 (r230272)
@@ -303,8 +303,9 @@ ng_tag_newhook(node_p node, hook_p hook,
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);
/*
More information about the svn-src-head
mailing list