mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 06:18:40 +08:00
drivers/misc: fix rpmsg dev poll assert crash
when client read and poll wait buffer from server side and server side may poll notify more than one times, then rpmsgdev in client side will call "rpmsgdev_poll_setup(priv, 0, false);" twice which will cause crash in vela rpmsgdev_server.c Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
parent
0bad7f814a
commit
d73815e3e9
1 changed files with 6 additions and 5 deletions
|
@ -403,12 +403,13 @@ static int rpmsgdev_poll_handler(FAR struct rpmsg_endpoint *ept,
|
|||
}
|
||||
else
|
||||
{
|
||||
DEBUGASSERT(dev->cfd != 0);
|
||||
|
||||
msg->header.result = file_poll(&dev->file, &dev->fd, false);
|
||||
if (msg->header.result == OK)
|
||||
if (dev->cfd != 0)
|
||||
{
|
||||
dev->cfd = 0;
|
||||
msg->header.result = file_poll(&dev->file, &dev->fd, false);
|
||||
if (msg->header.result == OK)
|
||||
{
|
||||
dev->cfd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue