summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-07-11 23:13:31 +0000
committertruckman <truckman@FreeBSD.org>2002-07-11 23:13:31 +0000
commitfe3b828f84110cc861c7b7e84b37defa519387ea (patch)
tree90b462359be64f48376c465a963917f73f556eb6 /sys/netinet
parent231c73de87db808098eb6dfb97628fc4dd06d4b6 (diff)
downloadFreeBSD-src-fe3b828f84110cc861c7b7e84b37defa519387ea.zip
FreeBSD-src-fe3b828f84110cc861c7b7e84b37defa519387ea.tar.gz
Reduce the nesting level of a code block that doesn't need to be in
an else clause.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_subr.c23
-rw-r--r--sys/netinet/tcp_timewait.c23
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)
OpenPOWER on IntegriCloud