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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to