semaphore: fix setting EINVAL in sem_post() and sem_wait()
authorEunBong Song <eunb.song@samsung.com>
Tue, 25 Apr 2017 10:29:25 +0000 (19:29 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Sat, 6 May 2017 13:46:10 +0000 (22:46 +0900)
commit649babfd9a60bacab6c17fdb0f831bc871d0f67d
treea947caf4d0858b90625078e7d7d22393a00865d1
parent2aeb54007de6e9ee61e99ac69b67c4ee2b6e7a34
semaphore: fix setting EINVAL in sem_post() and sem_wait()

This patch sets errno to EINVAL when sem argument is NULL in sem_post()
and sem_wait().

All credits should go to Paul A. Patience who wrote the original commit.

Change-Id: If51df37aefac2f1802f14e7c293d040e4c8d593b
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
Signed-off-by: Paul A. Patience <paul-a.patience@polymtl.ca>
[Song: backported 891113da from NuttX]
Signed-off-by: EunBong Song <eunb.song@samsung.com>
os/kernel/semaphore/sem_post.c
os/kernel/semaphore/sem_wait.c