diff --git a/drivers/misc/goldfish_pipe.c b/drivers/misc/goldfish_pipe.c index 1f705eadd67..fabc76864c9 100644 --- a/drivers/misc/goldfish_pipe.c +++ b/drivers/misc/goldfish_pipe.c @@ -531,7 +531,7 @@ static int goldfish_pipe_poll(FAR struct file *filp, mask |= EPOLLERR; if (mask) - poll_notify(dev->fds, 1, mask); + poll_notify(dev->fds, dev->pipes_capacity, mask); } else if (fds->priv != NULL) { @@ -943,6 +943,13 @@ int goldfish_pipe_register(void *base, int irq) return -ENOMEM; } + dev->fds = kmm_calloc(dev->pipes_capacity, sizeof(*dev->fds)); + + if (!dev->fds) + { + return -ENOMEM; + } + /* We're going to pass two buffers, open_command_params and * signalled_pipe_buffers, to the host. This means each of those buffers * needs to be contained in a single physical page. The easiest choice