diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-09 17:42:57 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-09 17:42:57 +0000 |
| commit | 42f2fa9953da13678b30942afc84e7e9fdd7c43e (patch) | |
| tree | 227d728aa2ba26270296f08e51d163d40615b060 /sys | |
| parent | c17418a0ba6eef8d2070d75844f9ede4ddbc413b (diff) | |
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/uipc_socket.c | 2 | ||||
| -rw-r--r-- | sys/kern/uipc_usrreq.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 029f7c8387ca..299610477068 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1195,7 +1195,7 @@ sofree(struct socket *so) so->so_dtor(so); VNET_SO_ASSERT(so); - if (pr->pr_flags & PR_RIGHTS) { + if ((pr->pr_flags & PR_RIGHTS) && !SOLISTENING(so)) { MPASS(pr->pr_domain->dom_dispose != NULL); (*pr->pr_domain->dom_dispose)(so); } diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 3ce7ddcd7f17..d56922c6fa3a 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2769,12 +2769,13 @@ unp_dispose(struct socket *so) { struct unpcb *unp; + MPASS(!SOLISTENING(so)); + unp = sotounpcb(so); UNP_LINK_WLOCK(); unp->unp_gcflag |= UNPGC_IGNORE_RIGHTS; UNP_LINK_WUNLOCK(); - if (!SOLISTENING(so)) - unp_dispose_mbuf(so->so_rcv.sb_mb); + unp_dispose_mbuf(so->so_rcv.sb_mb); } static void |
