rjones / rpms / qemu

Forked from rpms/qemu 5 months ago
Clone
1d442bb
From: Liu Bo <bo.liu@linux.alibaba.com>
1d442bb
Date: Mon, 27 Jan 2020 19:01:55 +0000
1d442bb
Subject: [PATCH] virtiofsd: fix error handling in main()
1d442bb
MIME-Version: 1.0
1d442bb
Content-Type: text/plain; charset=UTF-8
1d442bb
Content-Transfer-Encoding: 8bit
1d442bb
1d442bb
Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place
1d442bb
to do cleanup.
1d442bb
1d442bb
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
1d442bb
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442bb
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442bb
(cherry picked from commit c6de804670f2255ce776263124c37f3370dc5ac1)
1d442bb
---
1d442bb
 tools/virtiofsd/passthrough_ll.c | 5 +++--
1d442bb
 1 file changed, 3 insertions(+), 2 deletions(-)
1d442bb
1d442bb
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
1d442bb
index 9ed77a17fd..af050c6d97 100644
1d442bb
--- a/tools/virtiofsd/passthrough_ll.c
1d442bb
+++ b/tools/virtiofsd/passthrough_ll.c
1d442bb
@@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
1d442bb
     lo_map_init(&lo.fd_map);
1d442bb
 
1d442bb
     if (fuse_parse_cmdline(&args, &opts) != 0) {
1d442bb
-        return 1;
1d442bb
+        goto err_out1;
1d442bb
     }
1d442bb
     fuse_set_log_func(log_func);
1d442bb
     use_syslog = opts.syslog;
1d442bb
     if (use_syslog) {
1d442bb
         openlog("virtiofsd", LOG_PID, LOG_DAEMON);
1d442bb
     }
1d442bb
+
1d442bb
     if (opts.show_help) {
1d442bb
         printf("usage: %s [options]\n\n", argv[0]);
1d442bb
         fuse_cmdline_help();
1d442bb
@@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
1d442bb
     }
1d442bb
 
1d442bb
     if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
1d442bb
-        return 1;
1d442bb
+        goto err_out1;
1d442bb
     }
1d442bb
 
1d442bb
     /*