diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 7c1d8d93baba..794461ed738a 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -903,8 +903,10 @@ udp_attach(struct socket *so, int proto, struct thread *td) s = splnet(); error = in_pcballoc(so, &udbinfo, td); splx(s); - if (error) + if (error) { + INP_INFO_WUNLOCK(&udbinfo); return error; + } inp = (struct inpcb *)so->so_pcb; INP_LOCK(inp);