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

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

commit 0d0facd6cd2036f0d5810cc9fad582f52616e5a0
Author: Bowen Wang <[email protected]>
AuthorDate: Mon May 25 16:00:15 2026 +0800

    drivers/syslog/syslog_rpmsg: do not transfer during reset or panic
    
    Sending log over rpmsg while the system is resetting or has panicked
    can block or fault. Leave the log in the buffer instead, overwriting
    the oldest data when it is full.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/syslog/syslog_rpmsg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index 62cf1ad3e6d..546ec12804b 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -37,6 +37,7 @@
 #include <nuttx/arch.h>
 #endif
 
+#include <nuttx/init.h>
 #include <nuttx/irq.h>
 #include <nuttx/syslog/syslog_rpmsg.h>
 
@@ -148,7 +149,7 @@ static bool syslog_rpmsg_transfer(FAR struct syslog_rpmsg_s 
*priv, bool wait)
   uint32_t len_end;
   uint32_t len;
 
-  if (!is_rpmsg_ept_ready(&priv->ept))
+  if (g_nx_initstate >= OSINIT_RESET || !is_rpmsg_ept_ready(&priv->ept))
     {
       return false;
     }

Reply via email to