If off-page lookup failed, there is no memory to perform
shared_mutex_init() upon. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
6573205a07
commit
fe60c14631
@ -476,7 +476,8 @@ check_and_init_mutex(pthread_mutex_t *mutex, struct pthread_mutex **m)
|
||||
*m = __thr_pshared_offpage(mutex, 0);
|
||||
if (*m == NULL)
|
||||
ret = EINVAL;
|
||||
shared_mutex_init(*m, NULL);
|
||||
else
|
||||
shared_mutex_init(*m, NULL);
|
||||
} else if (__predict_false(*m <= THR_MUTEX_DESTROYED)) {
|
||||
if (*m == THR_MUTEX_DESTROYED) {
|
||||
ret = EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user