diff options
-rw-r--r-- | sys/netinet/tcp_subr.c | 23 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 23 |
2 files changed, 20 insertions, 26 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 5b2dfd0..07deac9 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -931,14 +931,12 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) if (inp == NULL) { error = ENOENT; goto outunlocked; - } else { - INP_LOCK(inp); - if (inp->inp_socket == NULL) { - error = ENOENT; - goto out; - } } - + INP_LOCK(inp); + if (inp->inp_socket == NULL) { + error = ENOENT; + goto out; + } error = cr_canseesocket(req->td->td_ucred, inp->inp_socket); if (error) goto out; @@ -994,12 +992,11 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) if (inp == NULL) { error = ENOENT; goto outunlocked; - } else { - INP_LOCK(inp); - if (inp->inp_socket == NULL) { - error = ENOENT; - goto out; - } + } + INP_LOCK(inp); + if (inp->inp_socket == NULL) { + error = ENOENT; + goto out; } error = cr_canseesocket(req->td->td_ucred, inp->inp_socket); if (error) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 5b2dfd0..07deac9 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -931,14 +931,12 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) if (inp == NULL) { error = ENOENT; goto outunlocked; - } else { - INP_LOCK(inp); - if (inp->inp_socket == NULL) { - error = ENOENT; - goto out; - } } - + INP_LOCK(inp); + if (inp->inp_socket == NULL) { + error = ENOENT; + goto out; + } error = cr_canseesocket(req->td->td_ucred, inp->inp_socket); if (error) goto out; @@ -994,12 +992,11 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) if (inp == NULL) { error = ENOENT; goto outunlocked; - } else { - INP_LOCK(inp); - if (inp->inp_socket == NULL) { - error = ENOENT; - goto out; - } + } + INP_LOCK(inp); + if (inp->inp_socket == NULL) { + error = ENOENT; + goto out; } error = cr_canseesocket(req->td->td_ucred, inp->inp_socket); if (error) |