From 7ec304e6a88bfc41727eaeeec4566b7d8d0d0f83 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Fri, 10 May 2024 10:05:42 +0800 Subject: [PATCH] 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 --- 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 6094fc4735f..5c39b4a44e7 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; }