Acquire udbinfo lock after call to soreserve() rather than before, as it
is not required. This simplifies error-handling, and reduces the time that this lock is held. MFC after: 1 month
This commit is contained in:
parent
7490082f08
commit
f24618aaf0
@ -962,12 +962,10 @@ udp_attach(struct socket *so, int proto, struct thread *td)
|
||||
|
||||
inp = sotoinpcb(so);
|
||||
KASSERT(inp == NULL, ("udp_attach: inp != NULL"));
|
||||
INP_INFO_WLOCK(&udbinfo);
|
||||
error = soreserve(so, udp_sendspace, udp_recvspace);
|
||||
if (error) {
|
||||
INP_INFO_WUNLOCK(&udbinfo);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
INP_INFO_WLOCK(&udbinfo);
|
||||
error = in_pcballoc(so, &udbinfo, "udpinp");
|
||||
if (error) {
|
||||
INP_INFO_WUNLOCK(&udbinfo);
|
||||
|
Loading…
Reference in New Issue
Block a user