diff options
author | truckman <truckman@FreeBSD.org> | 2002-07-12 09:55:48 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2002-07-12 09:55:48 +0000 |
commit | 90d4a243cd9bd1fa8feef3706d4fb1d9f168dbc8 (patch) | |
tree | d2d23fac00510b7ebc37361ff88c99f2e538acf2 /sys/netinet/udp_usrreq.c | |
parent | 326ff2eb35bf64848ee65406b15ac9c9f46fa50d (diff) | |
download | FreeBSD-src-90d4a243cd9bd1fa8feef3706d4fb1d9f168dbc8.zip FreeBSD-src-90d4a243cd9bd1fa8feef3706d4fb1d9f168dbc8.tar.gz |
Back out the previous change, since it looks like locking udbinfo provides
sufficient protection.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a40015c..56bb1e1 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -681,12 +681,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS) INP_INFO_RLOCK(&udbinfo); inp = in_pcblookup_hash(&udbinfo, addrs[1].sin_addr, addrs[1].sin_port, addrs[0].sin_addr, addrs[0].sin_port, 1, NULL); - if (inp == NULL) { - error = ENOENT; - goto outunlocked; - } - INP_LOCK(inp); - if (inp->inp_socket == NULL) { + if (inp == NULL || inp->inp_socket == NULL) { error = ENOENT; goto out; } @@ -695,8 +690,6 @@ udp_getcred(SYSCTL_HANDLER_ARGS) goto out; cru2x(inp->inp_socket->so_cred, &xuc); out: - INP_UNLOCK(inp); -outunlocked: INP_INFO_RUNLOCK(&udbinfo); splx(s); if (error == 0) |