summaryrefslogtreecommitdiff
path: root/tools/env/fw_env.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2016-04-29 22:00:11 +0200
committerTom Rini <trini@konsulko.com>2016-05-02 18:37:10 -0400
commit925c97c248527391de32c2926f7e1911850fd4b0 (patch)
treefa88c53b922ccfef7c5da2d0d32e6b0bc5157578 /tools/env/fw_env.c
parentf9f9d2d625056b674145b6773fe2d91852e4a7fa (diff)
tools: env: fix config file loading in env library
env library is broken as the config file pointer is only initialized in main(). When running in the env library parse_config() fails: Cannot parse config file '(null)': Bad address Ensure that config file pointer is always initialized. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'tools/env/fw_env.c')
-rw-r--r--tools/env/fw_env.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 1420ac58a3..06cf63daa4 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1325,6 +1325,9 @@ static int parse_config ()
struct stat st;
#if defined(CONFIG_FILE)
+ if (!common_args.config_file)
+ common_args.config_file = CONFIG_FILE;
+
/* Fills in DEVNAME(), ENVSIZE(), DEVESIZE(). Or don't. */
if (get_config(common_args.config_file)) {
fprintf(stderr, "Cannot parse config file '%s': %m\n",