Author: gnn
Date: Wed Aug 1 19:27:12 2012
New Revision: 238979
URL: http://svn.freebsd.org/changeset/base/238979
Log:
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
MFC after: 2 weeks
Modified:
head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Wed Aug
1 18:52:07 2012 (r238978)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Wed Aug
1 19:27:12 2012 (r238979)
@@ -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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"