Author: markj
Date: Tue Sep 15 23:03:56 2020
New Revision: 365788
URL: https://svnweb.freebsd.org/changeset/base/365788

Log:
  Fix locking in uipc_accept().
  
  Reported by:  cy
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c Tue Sep 15 22:19:16 2020        (r365787)
+++ head/sys/kern/uipc_usrreq.c Tue Sep 15 23:03:56 2020        (r365788)
@@ -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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to