You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/01/05 04:30:55 UTC

(nuttx) branch master updated: rpmsgdev_server: do not notify the client when the fds has teardown

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new fe0cd18cc5 rpmsgdev_server: do not notify the client when the fds has teardown
fe0cd18cc5 is described below

commit fe0cd18cc513f97c5456e51bef76f1dc00893b7c
Author: Bowen Wang <wa...@xiaomi.com>
AuthorDate: Thu Jul 20 18:26:25 2023 +0800

    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 <wa...@xiaomi.com>
---
 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 856db037ec..5cdecaa34f 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);
-
-  msg.header.command = RPMSGDEV_NOTIFY;
-  msg.revents = fds->revents;
-  msg.fds     = dev->cfd;
+  if (dev->cfd != 0)
+    {
+      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));
+    }
 }
 
 /****************************************************************************