From: Jens Axboe Date: Mon, 14 Apr 2014 19:11:19 +0000 (-0600) Subject: idletime: unlock ->start_lock in error cases X-Git-Tag: fio-2.1.9~29 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=735ed278a7ba6e3f1d5a0c08fc08149a2f435c37 idletime: unlock ->start_lock in error cases Signed-off-by: Jens Axboe --- diff --git a/idletime.c b/idletime.c index bc809768..8d23154e 100644 --- a/idletime.c +++ b/idletime.c @@ -109,12 +109,16 @@ static void *idle_prof_thread_fn(void *data) pthread_mutex_lock(&ipt->start_lock); /* exit if other threads failed to initialize */ - if (ipc.status == IDLE_PROF_STATUS_ABORT) + if (ipc.status == IDLE_PROF_STATUS_ABORT) { + pthread_mutex_unlock(&ipt->start_lock); return NULL; + } /* exit if we are doing calibration only */ - if (ipc.status == IDLE_PROF_STATUS_CALI_STOP) + if (ipc.status == IDLE_PROF_STATUS_CALI_STOP) { + pthread_mutex_unlock(&ipt->start_lock); return NULL; + } fio_gettime(&ipt->tps, NULL); ipt->state = TD_RUNNING;