Fix locking in uipc_accept().

Reported by:	cy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2020-09-15 23:03:56 +00:00
parent 081e36e760
commit b4e07e3da5

View file

@ -506,7 +506,10 @@ uipc_accept(struct socket *so, struct sockaddr **nam)
else
sa = &sun_noname;
bcopy(sa, *nam, sa->sa_len);
unp_pcb_unlock_pair(unp, unp2);
if (unp2 != NULL)
unp_pcb_unlock_pair(unp, unp2);
else
UNP_PCB_UNLOCK(unp);
return (0);
}