diff --git a/drivers/pipes/pipe_common.c b/drivers/pipes/pipe_common.c index 03509461e3..532e705671 100644 --- a/drivers/pipes/pipe_common.c +++ b/drivers/pipes/pipe_common.c @@ -704,7 +704,7 @@ int pipecommon_poll(FAR struct file *filep, FAR struct pollfd *fds, } else { - nbytes = (dev->d_bufsize - 1) + dev->d_wrndx - dev->d_rdndx; + nbytes = dev->d_bufsize + dev->d_wrndx - dev->d_rdndx; } /* Notify the POLLOUT event if the pipe is not full, but only if