summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-07-11 21:56:58 +0000
committerrwatson <rwatson@FreeBSD.org>2006-07-11 21:56:58 +0000
commitb7a5696a9bda1d0dfd383a3ac205be5a490d5ccb (patch)
tree40b5cbef941f252838e58ced515e55ea6dbe6f4c /sys/kern
parent7647a9354ef36efc83208d186d15693c50cf5627 (diff)
downloadFreeBSD-src-b7a5696a9bda1d0dfd383a3ac205be5a490d5ccb.zip
FreeBSD-src-b7a5696a9bda1d0dfd383a3ac205be5a490d5ccb.tar.gz
When pru_attach() fails, call sodealloc() on the socket rather than
using sorele() and the full tear-down path. Since protocol state allocation failed, this is not required (and is arguably undesirable). This matches the behavior of sonewconn() under the same circumstances.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_socket.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 710ddd0..879fa32 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -353,10 +353,7 @@ socreate(dom, aso, type, proto, cred, td)
so->so_count = 1;
error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
if (error) {
- ACCEPT_LOCK();
- SOCK_LOCK(so);
- so->so_state |= SS_NOFDREF;
- sorele(so);
+ sodealloc(so);
return (error);
}
*aso = so;
OpenPOWER on IntegriCloud