22c213
From ece7649025fbdbde48ff0b954e8ec2e42c4a8b3d Mon Sep 17 00:00:00 2001
22c213
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
22c213
Date: Tue, 3 Mar 2020 18:43:10 +0000
22c213
Subject: [PATCH 14/18] virtiofsd: load_capng missing unlock
22c213
MIME-Version: 1.0
22c213
Content-Type: text/plain; charset=UTF-8
22c213
Content-Transfer-Encoding: 8bit
22c213
22c213
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
Message-id: <20200303184314.155564-4-dgilbert@redhat.com>
22c213
Patchwork-id: 94126
22c213
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 3/7] virtiofsd: load_capng missing unlock
22c213
Bugzilla: 1797064
22c213
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
22c213
RH-Acked-by: Ján Tomko <jtomko@redhat.com>
22c213
22c213
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
22c213
22c213
Missing unlock in error path.
22c213
22c213
Fixes: Covertiy CID 1413123
22c213
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
22c213
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
22c213
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
(cherry picked from commit 686391112fd42c615bcc4233472887a66a9b5a4a)
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
22c213
 tools/virtiofsd/passthrough_ll.c | 1 +
22c213
 1 file changed, 1 insertion(+)
22c213
22c213
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
22c213
index e6f2399..c635fc8 100644
22c213
--- a/tools/virtiofsd/passthrough_ll.c
22c213
+++ b/tools/virtiofsd/passthrough_ll.c
22c213
@@ -232,6 +232,7 @@ static int load_capng(void)
22c213
          */
22c213
         cap.saved = capng_save_state();
22c213
         if (!cap.saved) {
22c213
+            pthread_mutex_unlock(&cap.mutex);
22c213
             fuse_log(FUSE_LOG_ERR, "capng_save_state (thread)\n");
22c213
             return -EINVAL;
22c213
         }
22c213
-- 
22c213
1.8.3.1
22c213