902636
From 0ea1c7375d6509367399c706eb9d1e8cf79a5830 Mon Sep 17 00:00:00 2001
902636
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
902636
Date: Mon, 27 Jan 2020 19:01:55 +0100
902636
Subject: [PATCH 084/116] virtiofsd: fix error handling in main()
902636
MIME-Version: 1.0
902636
Content-Type: text/plain; charset=UTF-8
902636
Content-Transfer-Encoding: 8bit
902636
902636
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Message-id: <20200127190227.40942-81-dgilbert@redhat.com>
902636
Patchwork-id: 93534
902636
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 080/112] virtiofsd: fix error handling in main()
902636
Bugzilla: 1694164
902636
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
902636
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
902636
902636
From: Liu Bo <bo.liu@linux.alibaba.com>
902636
902636
Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place
902636
to do cleanup.
902636
902636
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
902636
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
902636
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
(cherry picked from commit c6de804670f2255ce776263124c37f3370dc5ac1)
902636
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
902636
---
902636
 tools/virtiofsd/passthrough_ll.c | 5 +++--
902636
 1 file changed, 3 insertions(+), 2 deletions(-)
902636
902636
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
902636
index 9ed77a1..af050c6 100644
902636
--- a/tools/virtiofsd/passthrough_ll.c
902636
+++ b/tools/virtiofsd/passthrough_ll.c
902636
@@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
902636
     lo_map_init(&lo.fd_map);
902636
 
902636
     if (fuse_parse_cmdline(&args, &opts) != 0) {
902636
-        return 1;
902636
+        goto err_out1;
902636
     }
902636
     fuse_set_log_func(log_func);
902636
     use_syslog = opts.syslog;
902636
     if (use_syslog) {
902636
         openlog("virtiofsd", LOG_PID, LOG_DAEMON);
902636
     }
902636
+
902636
     if (opts.show_help) {
902636
         printf("usage: %s [options]\n\n", argv[0]);
902636
         fuse_cmdline_help();
902636
@@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
902636
     }
902636
 
902636
     if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
902636
-        return 1;
902636
+        goto err_out1;
902636
     }
902636
 
902636
     /*
902636
-- 
902636
1.8.3.1
902636