diff --git a/include/sys/mutex.h b/include/sys/mutex.h index ab98a5490b3..29d7aee160d 100644 --- a/include/sys/mutex.h +++ b/include/sys/mutex.h @@ -156,16 +156,7 @@ static inline int sys_mutex_lock(struct sys_mutex *mutex, k_timeout_t timeout) static inline int sys_mutex_unlock(struct sys_mutex *mutex) { - if (mutex->kernel_mutex.lock_count == 0) { - return -EINVAL; - } - - if (mutex->kernel_mutex.owner != _current) { - return -EPERM; - } - - k_mutex_unlock(&mutex->kernel_mutex); - return 0; + return k_mutex_unlock(&mutex->kernel_mutex); } #endif /* CONFIG_USERSPACE */