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/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d24582  syslog_rpmsg: fix system crash when open 
CONFIG_SCHED_HAVE_PARENT
0d24582 is described below

commit 0d24582fe021b5d59b3603a05c7938be9dd3888f
Author: ligd <liguidi...@xiaomi.com>
AuthorDate: Mon Jan 25 20:06:10 2021 +0800

    syslog_rpmsg: fix system crash when open CONFIG_SCHED_HAVE_PARENT
    
    Reason:
    nx_start use syslog at every early time event the idle thread not
    full setup, then syslog_rpmsg -> work_queue -> work_signal ->
    nxsig_kill -> rtcb is NULL -> crash
    
    Fix:
    sched work_queue after is_rpmsg_ept_ready() is true
    
    Change-Id: I225469ff2526e4b810bf3e23473b55d57e64a1ff
    Signed-off-by: ligd <liguidi...@xiaomi.com>
---
 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 c415713..6b35e29 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -186,7 +186,8 @@ static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s 
*priv, int ch,
         }
     }
 
-  if (last && !priv->suspend && !priv->transfer)
+  if (last && !priv->suspend && !priv->transfer &&
+          is_rpmsg_ept_ready(&priv->ept))
     {
       clock_t delay = SYSLOG_RPMSG_WORK_DELAY;
       size_t space = SYSLOG_RPMSG_SPACE(priv->head, priv->tail, priv->size);

Reply via email to