From: mvs Date: Sat, 30 Oct 2021 16:35:31 +0000 (+0000) Subject: Kill the dead code from unp_drop(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ecb3537395b6d3ef6a196688f206e1c0c93f35b6;p=openbsd Kill the dead code from unp_drop(). The unp_drop() was removed from the 'PRU_ABORT' path in the previous commit. Now it only remains in the unp_detach() where disconnects the connected datagram sockets linked to the `unp_link' list. Such sockets always have the associated file descriptor and never had been linked to the `so_q0' or `so_q' of listening socket so their `so_head' is always NULL. ok millert@ sashan@ mpi@ --- diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index a90e88d5b07..0994f76abea 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.152 2021/10/30 16:24:18 mvs Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.153 2021/10/30 16:35:31 mvs Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -783,17 +783,6 @@ unp_drop(struct unpcb *unp, int errno) so->so_error = errno; unp_disconnect(unp); - if (so->so_head) { - so->so_pcb = NULL; - /* - * As long as `unp_lock' is taken before entering - * uipc_usrreq() releasing it here would lead to a - * double unlock. - */ - sofree(so, SL_NOUNLOCK); - m_freem(unp->unp_addr); - pool_put(&unpcb_pool, unp); - } } #ifdef notdef