kernel/netgraph7: Replace usage of MALLOC/FREE with kmalloc/kfree here too.
[dragonfly.git] / sys / netgraph7 / bluetooth / socket / ng_btsocket_l2cap.c
index a691b9d..32029f1 100644 (file)
@@ -1557,8 +1557,8 @@ ng_btsocket_l2cap_default_msg_input(struct ng_mesg *msg, hook_p hook)
 
                rt = (ng_btsocket_l2cap_rtentry_t *) NG_HOOK_PRIVATE(hook);
                if (rt == NULL) {
-                       MALLOC(rt, ng_btsocket_l2cap_rtentry_p, sizeof(*rt),
-                               M_NETGRAPH_BTSOCKET_L2CAP, M_WAITOK | M_NULLOK | M_ZERO);
+                       rt = kmalloc(sizeof(*rt), M_NETGRAPH_BTSOCKET_L2CAP,
+                                    M_WAITOK | M_NULLOK | M_ZERO);
                        if (rt == NULL) {
                                mtx_unlock(&ng_btsocket_l2cap_rt_mtx);
                                break;
@@ -1782,7 +1782,7 @@ ng_btsocket_l2cap_rtclean(void *context, int pending)
                        NG_HOOK_UNREF(rt->hook); /* Remove extra reference */
 
                        bzero(rt, sizeof(*rt));
-                       FREE(rt, M_NETGRAPH_BTSOCKET_L2CAP);
+                       kfree(rt, M_NETGRAPH_BTSOCKET_L2CAP);
                }
 
                rt = rt_next;
@@ -1924,8 +1924,8 @@ ng_btsocket_l2cap_attach(struct socket *so, int proto, struct thread *td)
        }
 
        /* Allocate the PCB */
-        MALLOC(pcb, ng_btsocket_l2cap_pcb_p, sizeof(*pcb),
-               M_NETGRAPH_BTSOCKET_L2CAP, M_WAITOK | M_NULLOK | M_ZERO);
+        pcb = kmalloc(sizeof(*pcb), M_NETGRAPH_BTSOCKET_L2CAP,
+                     M_WAITOK | M_NULLOK | M_ZERO);
         if (pcb == NULL)
                 return (ENOMEM);
 
@@ -2304,7 +2304,7 @@ ng_btsocket_l2cap_detach(struct socket *so)
 
        mtx_destroy(&pcb->pcb_mtx);
        bzero(pcb, sizeof(*pcb));
-       FREE(pcb, M_NETGRAPH_BTSOCKET_L2CAP);
+       kfree(pcb, M_NETGRAPH_BTSOCKET_L2CAP);
 
        soisdisconnected(so);
        so->so_pcb = NULL;