From 142b2bd644f86d87e84b467413c503fed3f4bb5a Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Thu, 11 Jul 2002 23:13:31 +0000 Subject: [PATCH] Reduce the nesting level of a code block that doesn't need to be in an else clause. --- sys/netinet/tcp_subr.c | 23 ++++++++++------------- 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 5b2dfd01641..07deac9a519 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 5b2dfd01641..07deac9a519 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)