diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2041,13 +2041,7 @@ */ newlen = newfds * sizeof(int); *controlp = sbcreatecontrol(NULL, newlen, - SCM_RIGHTS, SOL_SOCKET, M_NOWAIT); - if (*controlp == NULL) { - FILEDESC_XUNLOCK(fdesc); - error = E2BIG; - unp_freerights(fdep, newfds); - goto next; - } + SCM_RIGHTS, SOL_SOCKET, M_WAITOK); fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); @@ -2079,11 +2073,7 @@ if (error || controlp == NULL) goto next; *controlp = sbcreatecontrol(NULL, datalen, - cm->cmsg_type, cm->cmsg_level, M_NOWAIT); - if (*controlp == NULL) { - error = ENOBUFS; - goto next; - } + cm->cmsg_type, cm->cmsg_level, M_WAITOK); bcopy(data, CMSG_DATA(mtod(*controlp, struct cmsghdr *)), datalen);