From: Sepherosa Ziehau Date: Sat, 15 Mar 2014 13:30:55 +0000 (+0800) Subject: inpcb: in_pcblookup_addrport() must have been protected by port token X-Git-Tag: v3.9.0~319 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/4e89c94a8bbff04e0d96321c9abb0dc85c172149 inpcb: in_pcblookup_addrport() must have been protected by port token --- diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index e753c54e5a..20f948d251 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -522,11 +522,11 @@ in_pcblookup_addrport(struct inpcbinfo *pcbinfo, struct in_addr laddr, struct inpcb *match = NULL; /* - * If the porthashbase is shared across several cpus we need - * to lock. + * If the porthashbase is shared across several cpus, it must + * have been locked. */ if (pcbinfo->porttoken) - lwkt_gettoken(pcbinfo->porttoken); + ASSERT_LWKT_TOKEN_HELD(pcbinfo->porttoken); /* * Best fit PCB lookup. @@ -565,8 +565,6 @@ in_pcblookup_addrport(struct inpcbinfo *pcbinfo, struct in_addr laddr, } } } - if (pcbinfo->porttoken) - lwkt_reltoken(pcbinfo->porttoken); return (match); }