idletime: unlock ->start_lock in error cases
authorJens Axboe <axboe@fb.com>
Mon, 14 Apr 2014 19:11:19 +0000 (13:11 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 14 Apr 2014 19:11:19 +0000 (13:11 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
idletime.c

index bc8097680d69f37b139495b61f56287b588c9693..8d23154e54c94ee1ae5af8b05582fd2ed90dfc46 100644 (file)
@@ -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;