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 2021/08/07 04:09:17 UTC

[incubator-nuttx] branch master updated: sched: Fix crash on early syslog message with prepended process name

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 b145ad8  sched: Fix crash on early syslog message with prepended process name
b145ad8 is described below

commit b145ad82b7a7efde0375a36d081cd2ff41e0b2ab
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Fri Aug 6 17:09:09 2021 -0300

    sched: Fix crash on early syslog message with prepended process name
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 sched/sched/sched_gettcb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sched/sched/sched_gettcb.c b/sched/sched/sched_gettcb.c
index 9b31aa2..776927d 100644
--- a/sched/sched/sched_gettcb.c
+++ b/sched/sched/sched_gettcb.c
@@ -56,9 +56,11 @@ FAR struct tcb_s *nxsched_get_tcb(pid_t pid)
   irqstate_t flags;
   int hash_ndx;
 
-  /* Verify that the PID is within range */
+  /* Verify whether g_pidhash hash table has already been allocated and
+   * whether the PID is within range.
+   */
 
-  if (pid >= 0)
+  if (g_pidhash != NULL && pid >= 0)
     {
       /* The test and the return setup should be atomic.  This still does
        * not provide proper protection if the recipient of the TCB does not