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);
 
        /*
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to