diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 708cefcb6df5..c00fd2d12368 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -2037,20 +2037,12 @@ retry_space: rem = obj->un_pager.vnp.vnp_size - uap->offset - fsbytes - loopbytes; xfsize = omin(rem, xfsize); + xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { VM_OBJECT_UNLOCK(obj); done = 1; /* all data sent */ break; } - /* - * Don't overflow the send buffer. - * Stop here and send out what we've - * already got. - */ - if (space < loopbytes + xfsize) { - VM_OBJECT_UNLOCK(obj); - break; - } /* * Attempt to look up the page. Allocate