svn commit: r244097 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common

George V. Neville-Neil gnn at FreeBSD.org
Mon Dec 10 21:18:02 UTC 2012


Author: gnn
Date: Mon Dec 10 21:18:02 2012
New Revision: 244097
URL: http://svnweb.freebsd.org/changeset/base/244097

Log:
  MFC: 238979
  
  When we return with an error we cannot unlock the mutex, because
  it's been freed.  Protect against that, hopefully unlikely, case.
  
  Reviewed by:	rpaulo

Modified:
  stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c	Mon Dec 10 20:52:52 2012	(r244096)
+++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c	Mon Dec 10 21:18:02 2012	(r244097)
@@ -942,7 +942,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp,
 		    (int)dpr->dpr_pid, strerror(err));
 	}
 
-	(void) pthread_mutex_unlock(&dpr->dpr_lock);
+	if (err == 0)
+		(void) pthread_mutex_unlock(&dpr->dpr_lock);
 	(void) pthread_attr_destroy(&a);
 
 	return (err);


More information about the svn-src-stable-9 mailing list