diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-07-11 21:56:58 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-07-11 21:56:58 +0000 |
commit | b7a5696a9bda1d0dfd383a3ac205be5a490d5ccb (patch) | |
tree | 40b5cbef941f252838e58ced515e55ea6dbe6f4c | |
parent | 7647a9354ef36efc83208d186d15693c50cf5627 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/kern/uipc_socket.c | 5 |
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; |