diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-05-07 22:07:23 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-05-07 22:07:23 +0000 |
commit | 54ea35f68b4dcf3d2fc191e30914ce2195117baa (patch) | |
tree | 37658633f881d908f9781bdf9e7b82d1395dac39 /cli_classic.c | |
parent | f1a4104ff54e81330a43e1264f5aaeba015c714e (diff) | |
download | flashrom-54ea35f68b4dcf3d2fc191e30914ce2195117baa.tar.gz |
Remove programmer_shutdown() from doit().
Because the programmer initialization that has to be called way
earlier and independently elsewhere, it does not make a lot of sense
to deinit within doit(). Also, free the logfile name at the end of
main() to catch more execution paths and because this moves it to
the other cleanup instructions.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1788 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cli_classic.c b/cli_classic.c index a0c2d64..a32d55b 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -338,8 +338,7 @@ int main(int argc, char *argv[]) if (logfile && check_filename(logfile, "log")) cli_classic_abort_usage(); if (logfile && open_logfile(logfile)) - return 1; - free(logfile); + cli_classic_abort_usage(); #endif /* !STANDALONE */ #if CONFIG_PRINT_WIKI == 1 @@ -522,8 +521,6 @@ int main(int argc, char *argv[]) */ programmer_delay(100000); ret |= doit(fill_flash, force, filename, read_it, write_it, erase_it, verify_it); - /* Note: doit() already calls programmer_shutdown(). */ - goto out; out_shutdown: programmer_shutdown(); @@ -539,6 +536,7 @@ out: free((char *)chip_to_probe); /* Silence! Freeing is not modifying contents. */ chip_to_probe = NULL; #ifndef STANDALONE + free(logfile); ret |= close_logfile(); #endif /* !STANDALONE */ return ret; |