#if NDRV_DEBUG
kprintf("NDRV attach: %x, %x, %x\n", so, proto, np);
#endif
+
+ if ((error = soreserve(so, ndrv_sendspace, ndrv_recvspace)))
+ return(error);
+
MALLOC(np, struct ndrv_cb *, sizeof(*np), M_PCB, M_WAITOK);
if (np == NULL)
return (ENOMEM);
#if NDRV_DEBUG
kprintf("NDRV attach: %x, %x, %x\n", so, proto, np);
#endif
- if ((error = soreserve(so, ndrv_sendspace, ndrv_recvspace)))
- return(error);
TAILQ_INIT(&np->nd_dlist);
np->nd_signature = NDRV_SIGNATURE;
np->nd_socket = so;
struct ndrv_cb* cur_np = NULL;
struct socket *so = np->nd_socket;
struct ndrv_multicast* next;
- int error;
+ int error = 0;
#if NDRV_DEBUG
kprintf("NDRV detach: %x, %x\n", so, np);