aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2002-07-12 09:55:48 +0000
committerDon Lewis <truckman@FreeBSD.org>2002-07-12 09:55:48 +0000
commit2d20c83f937a962801abc3bf82195147f13752db (patch)
treed2d23fac00510b7ebc37361ff88c99f2e538acf2 /sys/netinet/udp_usrreq.c
parent485a325e599909e1fe3740f51d5f2eeb5deafdae (diff)
Notes
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index a40015cafccf..56bb1e1310bb 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)