aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2003-08-11 19:37:11 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2003-08-11 19:37:11 +0000
commit660ebf0ef21a2acf57094f034b0179375b7d8f60 (patch)
treed0def6c90e137e0027feaa398e4d155870030489 /sys/kern/uipc_syscalls.c
parent507c0355a3b1714cbb99cf82d5266b187d5c0205 (diff)
downloadsrc-660ebf0ef21a2acf57094f034b0179375b7d8f60.tar.gz
src-660ebf0ef21a2acf57094f034b0179375b7d8f60.zip
Drop Giant in recvit before returning an error to the caller to avoid
leaking the Giant on the syscall exit.
Notes
Notes: svn path=/head/; revision=118794
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index e6f40769c8e9..c9dff02f5041 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -942,13 +942,16 @@ recvit(td, s, mp, namelenp)
#endif
mtx_lock(&Giant);
- if ((error = fgetsock(td, s, &so, NULL)) != 0)
+ if ((error = fgetsock(td, s, &so, NULL)) != 0) {
+ mtx_unlock(&Giant);
return (error);
+ }
#ifdef MAC
error = mac_check_socket_receive(td->td_ucred, so);
if (error) {
fputsock(so);
+ mtx_unlock(&Giant);
return (error);
}
#endif