virtiofsd: load_capng missing unlock
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 3 Feb 2020 12:25:56 +0000 (12:25 +0000)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 10 Feb 2020 17:24:43 +0000 (17:24 +0000)
Missing unlock in error path.

Fixes: Covertiy CID 1413123
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
tools/virtiofsd/passthrough_ll.c

index e6f2399efcb51d1382a7331e27195c9d9cdbac74..c635fc882032a874628b06c4d166a744da1aba01 100644 (file)
@@ -232,6 +232,7 @@ static int load_capng(void)
          */
         cap.saved = capng_save_state();
         if (!cap.saved) {
+            pthread_mutex_unlock(&cap.mutex);
             fuse_log(FUSE_LOG_ERR, "capng_save_state (thread)\n");
             return -EINVAL;
         }