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 <david.leach@nxp.com>
This commit is contained in:
David Leach 2020-07-24 11:01:04 -05:00 committed by Anas Nashif
commit 2abdc19ceb

View file

@ -238,6 +238,7 @@ void *_sbrk(int count)
{ {
void *ret, *ptr; void *ret, *ptr;
/* coverity[CHECKED_RETURN] */
sys_sem_take(&heap_sem, K_FOREVER); sys_sem_take(&heap_sem, K_FOREVER);
#if CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE #if CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE
@ -253,6 +254,7 @@ void *_sbrk(int count)
ret = (void *)-1; ret = (void *)-1;
} }
/* coverity[CHECKED_RETURN] */
sys_sem_give(&heap_sem); sys_sem_give(&heap_sem);
return ret; return ret;