pthread :checking for invalid rwlock parameters
This patch adds check for invalid rwlock initialization parameters.
@@ -71,8 +71,12 @@ int pthread_rwlock_init(FAR pthread_rwlock_t *lock, FAR const pthread_rwlockattr
{
int err;
+ if (lock == NULL) {
+ return EINVAL;
+ }
+
if (attr != NULL) {
- return -ENOSYS;
+ return ENOSYS;
}
lock->num_readers = 0;
