From fe0cd18cc513f97c5456e51bef76f1dc00893b7c Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Thu, 20 Jul 2023 18:26:25 +0800 Subject: [PATCH] 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 --- drivers/misc/rpmsgdev_server.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/misc/rpmsgdev_server.c b/drivers/misc/rpmsgdev_server.c index 856db037ec3..5cdecaa34fe 100644 --- a/drivers/misc/rpmsgdev_server.c +++ b/drivers/misc/rpmsgdev_server.c @@ -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)); + } } /****************************************************************************