From 2abdc19ceb8478ea275aaffcf39e5c5087179530 Mon Sep 17 00:00:00 2001 From: David Leach Date: Fri, 24 Jul 2020 11:01:04 -0500 Subject: [PATCH] libc: newlib: libc-hooks: Fix Coverity warning Suppress the coverity warning on using the semaphore as this semaphore is used and freed only in this function. Fixes: #18960 Signed-off-by: David Leach --- lib/libc/newlib/libc-hooks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c index 2bc2ea2599b..d03f117c6b2 100644 --- a/lib/libc/newlib/libc-hooks.c +++ b/lib/libc/newlib/libc-hooks.c @@ -238,6 +238,7 @@ void *_sbrk(int count) { void *ret, *ptr; + /* coverity[CHECKED_RETURN] */ sys_sem_take(&heap_sem, K_FOREVER); #if CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE @@ -253,6 +254,7 @@ void *_sbrk(int count) ret = (void *)-1; } + /* coverity[CHECKED_RETURN] */ sys_sem_give(&heap_sem); return ret;