zbd: Add a missing pthread_mutex_unlock() call
authorBart Van Assche <bvanassche@acm.org>
Sat, 30 May 2020 22:34:00 +0000 (15:34 -0700)
committerBart Van Assche <bvanassche@acm.org>
Tue, 8 Sep 2020 01:50:07 +0000 (18:50 -0700)
This patch fixes the following Coverity complaint:

CID 292491 (#1 of 1): Missing unlock (LOCK)
missing_unlock: Returning without unlocking zb->mutex.

Fixes: bfbdd35b3e8f ("Add support for zoned block devices")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
zbd.c

diff --git a/zbd.c b/zbd.c
index e8ecbb6f831e0a0fd23e2a150966e127ed004dbc..905c0c2b4323b7297aaac22ca9ad7c73661c603c 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -1546,6 +1546,7 @@ enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u)
        case DDIR_READ:
                if (td->runstate == TD_VERIFYING && td_write(td)) {
                        zb = zbd_replay_write_order(td, io_u, zb);
+                       pthread_mutex_unlock(&zb->mutex);
                        goto accept;
                }
                /*