diff options
author | truckman <truckman@FreeBSD.org> | 2002-07-11 23:18:43 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2002-07-11 23:18:43 +0000 |
commit | 5d8999f18a0f3915a58377ada8c5eba3770bcb42 (patch) | |
tree | 81d2779facad8b84176a57645f096be8d79ff82c /sys/netinet | |
parent | fe3b828f84110cc861c7b7e84b37defa519387ea (diff) | |
download | FreeBSD-src-5d8999f18a0f3915a58377ada8c5eba3770bcb42.zip FreeBSD-src-5d8999f18a0f3915a58377ada8c5eba3770bcb42.tar.gz |
Defer calling SYSCTL_OUT() until after the locks have been released.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 6 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 07deac9..9dab996 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -941,12 +941,13 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) if (error) goto out; cru2x(inp->inp_socket->so_cred, &xuc); - error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); out: INP_UNLOCK(inp); outunlocked: INP_INFO_RUNLOCK(&tcbinfo); splx(s); + if (error == 0) + error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); return (error); } @@ -1002,12 +1003,13 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) if (error) goto out; cru2x(inp->inp_socket->so_cred, &xuc); - error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); out: INP_UNLOCK(inp); outunlocked: INP_INFO_RUNLOCK(&tcbinfo); splx(s); + if (error == 0) + error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); return (error); } diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 07deac9..9dab996 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -941,12 +941,13 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) if (error) goto out; cru2x(inp->inp_socket->so_cred, &xuc); - error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); out: INP_UNLOCK(inp); outunlocked: INP_INFO_RUNLOCK(&tcbinfo); splx(s); + if (error == 0) + error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); return (error); } @@ -1002,12 +1003,13 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) if (error) goto out; cru2x(inp->inp_socket->so_cred, &xuc); - error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); out: INP_UNLOCK(inp); outunlocked: INP_INFO_RUNLOCK(&tcbinfo); splx(s); + if (error == 0) + error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); return (error); } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 31fb251..56bb1e1 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -689,10 +689,11 @@ udp_getcred(SYSCTL_HANDLER_ARGS) if (error) goto out; cru2x(inp->inp_socket->so_cred, &xuc); - error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); out: INP_INFO_RUNLOCK(&udbinfo); splx(s); + if (error == 0) + error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred)); return (error); } |