f2fs-tools: skipped to end on error syntax error

commit fcd5cd0b52
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

When error were found, we won't need to do any initialization but
just quit.

Signed-off-by: Robin Hsu <robinhsu@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Robin Hsu 2020-11-11 17:40:57 +08:00 committed by dongsenhao
parent de4f6bf2e0
commit df7acfde0a

View File

@ -597,20 +597,22 @@ void f2fs_parse_options(int argc, char *argv[])
}
}
add_default_options();
if (err == NOERROR) {
add_default_options();
if (optind >= argc) {
MSG(0, "\tError: Device not specified\n");
error_out(prog);
}
if (optind >= argc) {
MSG(0, "\tError: Device not specified\n");
error_out(prog);
}
c.devices[0].path = strdup(argv[optind]);
if (argc > (optind + 1)) {
c.dbg_lv = 0;
err = EUNKNOWN_ARG;
c.devices[0].path = strdup(argv[optind]);
if (argc > (optind + 1)) {
c.dbg_lv = 0;
err = EUNKNOWN_ARG;
}
if (err == NOERROR)
return;
}
if (err == NOERROR)
return;
/* print out error */
switch (err) {