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/05/10 11:42:18 UTC

(nuttx) branch master updated: pthread/join: catch null pexit_value case

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 7ec304e6a8 pthread/join: catch null pexit_value case
7ec304e6a8 is described below

commit 7ec304e6a88bfc41727eaeeec4566b7d8d0d0f83
Author: Yanfeng Liu <yf...@qq.com>
AuthorDate: Fri May 10 10:05:42 2024 +0800

    pthread/join: catch null pexit_value case
    
    This adds handling for null pointer in errout route as it crashes my
    ostest sometimes.
    
    Signed-off-by: Yanfeng Liu <yf...@qq.com>
---
 sched/pthread/pthread_join.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c
index 6094fc4735..5c39b4a44e 100644
--- a/sched/pthread/pthread_join.c
+++ b/sched/pthread/pthread_join.c
@@ -158,6 +158,14 @@ errout:
 
   leave_cancellation_point();
 
-  sinfo("Returning %d, exit_value %p\n", ret, *pexit_value);
+  if (pexit_value)
+    {
+      sinfo("Returning %d, exit_value %p\n", ret, *pexit_value);
+    }
+  else
+    {
+      sinfo("Returning %d\n", ret);
+    }
+
   return ret;
 }