diff options
author | gnn <gnn@FreeBSD.org> | 2012-08-01 19:27:12 +0000 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2012-08-01 19:27:12 +0000 |
commit | 3c9b732c82bfa914b21dab9569cadf47f3f7a913 (patch) | |
tree | 76874a7ccf36d0f9fbef9feef5a3036d188862eb /cddl/contrib/opensolaris/lib | |
parent | 15efb3237e9a81439bd1d63e4b7435c7c82f81c5 (diff) | |
download | FreeBSD-src-3c9b732c82bfa914b21dab9569cadf47f3f7a913.zip FreeBSD-src-3c9b732c82bfa914b21dab9569cadf47f3f7a913.tar.gz |
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
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c index caeeaa6..d40a0ae 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c @@ -942,7 +942,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, dt_proc_t *dpr, uint_t stop) (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); |