fds pointer not initialized cause dereference error
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
This commit is contained in:
parent
ce6382cc0c
commit
3fd404a4c5
@ -531,7 +531,7 @@ static int goldfish_pipe_poll(FAR struct file *filp,
|
|||||||
mask |= EPOLLERR;
|
mask |= EPOLLERR;
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
poll_notify(dev->fds, 1, mask);
|
poll_notify(dev->fds, dev->pipes_capacity, mask);
|
||||||
}
|
}
|
||||||
else if (fds->priv != NULL)
|
else if (fds->priv != NULL)
|
||||||
{
|
{
|
||||||
@ -943,6 +943,13 @@ int goldfish_pipe_register(void *base, int irq)
|
|||||||
return -ENOMEM;
|
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
|
/* We're going to pass two buffers, open_command_params and
|
||||||
* signalled_pipe_buffers, to the host. This means each of those buffers
|
* signalled_pipe_buffers, to the host. This means each of those buffers
|
||||||
* needs to be contained in a single physical page. The easiest choice
|
* needs to be contained in a single physical page. The easiest choice
|
||||||
|
Loading…
Reference in New Issue
Block a user