diff options
author | glebius <glebius@FreeBSD.org> | 2011-04-18 09:12:27 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2011-04-18 09:12:27 +0000 |
commit | 6c78a88c3bb5f7c87b56f79915289532c9997f86 (patch) | |
tree | 93e5d9fb7956c5887fdf3d8f3617c0eca1887866 /sys/netgraph/bluetooth | |
parent | 636bed78e5bc6ab20edda6b6d287c8fb8a71476f (diff) | |
download | FreeBSD-src-6c78a88c3bb5f7c87b56f79915289532c9997f86.zip FreeBSD-src-6c78a88c3bb5f7c87b56f79915289532c9997f86.tar.gz |
Node constructor methods are supposed to be called in syscall
context always. Convert nodes to consistently use M_WAITOK flag
for memory allocation.
Reviewed by: julian
Diffstat (limited to 'sys/netgraph/bluetooth')
-rw-r--r-- | sys/netgraph/bluetooth/hci/ng_hci_main.c | 5 | ||||
-rw-r--r-- | sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/sys/netgraph/bluetooth/hci/ng_hci_main.c b/sys/netgraph/bluetooth/hci/ng_hci_main.c index eeea79f..c5b3040 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_main.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_main.c @@ -109,10 +109,7 @@ ng_hci_constructor(node_p node) { ng_hci_unit_p unit = NULL; - unit = malloc(sizeof(*unit), M_NETGRAPH_HCI, - M_NOWAIT | M_ZERO); - if (unit == NULL) - return (ENOMEM); + unit = malloc(sizeof(*unit), M_NETGRAPH_HCI, M_WAITOK | M_ZERO); unit->node = node; unit->debug = NG_HCI_WARN_LEVEL; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c index 23c6b01..5ed61aa 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c @@ -113,10 +113,7 @@ ng_l2cap_constructor(node_p node) ng_l2cap_p l2cap = NULL; /* Create new L2CAP node */ - l2cap = malloc(sizeof(*l2cap), - M_NETGRAPH_L2CAP, M_NOWAIT|M_ZERO); - if (l2cap == NULL) - return (ENOMEM); + l2cap = malloc(sizeof(*l2cap), M_NETGRAPH_L2CAP, M_WAITOK | M_ZERO); l2cap->node = node; l2cap->debug = NG_L2CAP_WARN_LEVEL; |