diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-28 03:48:38 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-05-28 03:48:38 +0000 |
commit | d64f2f42c111009dade9ab7ae4d75a0256630e14 (patch) | |
tree | 56928b894f78bab3a9022f8e6d23547fbe9367e7 /sys/kern/uipc_usrreq.c | |
parent | a7bb120f8b8735bc4c417b3c8fc2308c3d2964aa (diff) | |
download | src-d64f2f42c111009dade9ab7ae4d75a0256630e14.tar.gz src-d64f2f42c111009dade9ab7ae4d75a0256630e14.zip |
unix: unp_externalize() can M_WAITOK
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35318
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 4903120fffeb..0796c383134c 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2041,13 +2041,7 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) */ 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 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) 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); |