udp6: fix build with INET6 and without INVARIANTS

Reported by:	Michael Butler <imb protected-networks.net>
Fixes:		483fe96511
This commit is contained in:
Gleb Smirnoff 2022-12-07 12:27:15 -08:00
parent 78ec113617
commit 3f89900bf1

View File

@ -1202,14 +1202,11 @@ static void
udp6_detach(struct socket *so)
{
struct inpcb *inp;
struct udpcb *up;
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_detach: inp == NULL"));
INP_WLOCK(inp);
up = intoudpcb(inp);
KASSERT(up != NULL, ("%s: up == NULL", __func__));
in_pcbdetach(inp);
in_pcbfree(inp);
}