From 507a06fa824e200e56a65ab00d10020c3b7878eb Mon Sep 17 00:00:00 2001 From: David Leach Date: Tue, 30 Mar 2021 16:28:26 -0500 Subject: [PATCH] tests: posix: Fix unchecked return coverity error New test cases did not check return value of pthread_attr_init() Fixes #33809 Signed-off-by: David Leach --- tests/posix/common/src/pthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/posix/common/src/pthread.c b/tests/posix/common/src/pthread.c index 82cede2cdca..04a5cff9c65 100644 --- a/tests/posix/common/src/pthread.c +++ b/tests/posix/common/src/pthread.c @@ -450,7 +450,8 @@ void test_posix_pthread_error_condition(void) EINVAL, "get datach state error"); /* Initialise thread attribute to ensure won't be return with init error */ - pthread_attr_init(&attr); + zassert_false(pthread_attr_init(&attr), + "Unable to create pthread object attr"); zassert_false(pthread_attr_setschedpolicy(&attr, 0), "set scheduling policy error"); zassert_false(pthread_attr_setschedpolicy(&attr, 1),