Skip to content

Commit f81293d

Browse files
cfriedtkartben
authored andcommitted
posix: semaphore: explicitly ignore return of k_mutex_unlock()
The nsem_list_unlock() static inline function looks as though it was designed to always ignore the return value of k_mutex_unlock(), presumably for performance reasons. A quick audit of the code looks as though the call should always succeed. Prepend (void) to the call to avoid the coverity defect in the future. CID 444386 Signed-off-by: Chris Friedt <[email protected]>
1 parent ed1ebb3 commit f81293d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/posix/options/semaphore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline void nsem_list_lock(void)
3333

3434
static inline void nsem_list_unlock(void)
3535
{
36-
k_mutex_unlock(&nsem_mutex);
36+
(void)k_mutex_unlock(&nsem_mutex);
3737
}
3838

3939
static struct nsem_obj *nsem_find(const char *name)

0 commit comments

Comments
 (0)