rpmsgdev_server: do not notify the client when the fds has teardown

Donothing instead assert when poll notify is called after teardown.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2023-07-20 18:26:25 +08:00 committed by Xiang Xiao
parent df3f95ee1f
commit fe0cd18cc5
1 changed files with 8 additions and 7 deletions

View File

@ -324,15 +324,16 @@ static void rpmsgdev_poll_worker(FAR void *arg)
container_of(fds, FAR struct rpmsgdev_device_s, fd);
FAR struct rpmsgdev_notify_s msg;
DEBUGASSERT(dev->cfd != 0);
if (dev->cfd != 0)
{
msg.header.command = RPMSGDEV_NOTIFY;
msg.revents = fds->revents;
msg.fds = dev->cfd;
msg.header.command = RPMSGDEV_NOTIFY;
msg.revents = fds->revents;
msg.fds = dev->cfd;
fds->revents = 0;
fds->revents = 0;
rpmsg_send(&server->ept, &msg, sizeof(msg));
rpmsg_send(&server->ept, &msg, sizeof(msg));
}
}
/****************************************************************************