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
This commit is contained in:
George V. Neville-Neil 2012-08-01 19:27:12 +00:00
parent f5705b527d
commit 26d121f5df

View File

@ -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);