summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLiu Bo <bo.liu@linux.alibaba.com>2019-06-05 08:42:35 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-23 16:41:37 +0000
commitc6de804670f2255ce776263124c37f3370dc5ac1 (patch)
treec55ac5c025e873bd172f878ede26c9a127858a6d /tools
parent8a792b034d4b315251fd842bb4c73a133aa1368f (diff)
downloadqemu-c6de804670f2255ce776263124c37f3370dc5ac1.zip
virtiofsd: fix error handling in main()
Neither fuse_parse_cmdline() nor fuse_opt_parse() goes to the right place to do cleanup. Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtiofsd/passthrough_ll.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 9ed77a17fd..af050c6d97 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -2443,13 +2443,14 @@ int main(int argc, char *argv[])
lo_map_init(&lo.fd_map);
if (fuse_parse_cmdline(&args, &opts) != 0) {
- return 1;
+ goto err_out1;
}
fuse_set_log_func(log_func);
use_syslog = opts.syslog;
if (use_syslog) {
openlog("virtiofsd", LOG_PID, LOG_DAEMON);
}
+
if (opts.show_help) {
printf("usage: %s [options]\n\n", argv[0]);
fuse_cmdline_help();
@@ -2468,7 +2469,7 @@ int main(int argc, char *argv[])
}
if (fuse_opt_parse(&args, &lo, lo_opts, NULL) == -1) {
- return 1;
+ goto err_out1;
}
/*