mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Defer calling SYSCTL_OUT() until after the locks have been released.
This commit is contained in:
parent
142b2bd644
commit
0e1eebb846
3 changed files with 10 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue