Date: Tue, 12 Apr 2016 10:25:45 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297853 - head/lib/libthr/thread Message-ID: <201604121025.u3CAPjGo043592@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Apr 12 10:25:44 2016 New Revision: 297853 URL: https://svnweb.freebsd.org/changeset/base/297853 Log: If off-page lookup failed, there is no memory to perform shared_mutex_init() upon. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue Apr 12 07:54:55 2016 (r297852) +++ head/lib/libthr/thread/thr_mutex.c Tue Apr 12 10:25:44 2016 (r297853) @@ -476,7 +476,8 @@ check_and_init_mutex(pthread_mutex_t *mu *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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604121025.u3CAPjGo043592>