summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2015-12-23 12:07:24 +0800
committerTom Rini <trini@konsulko.com>2016-01-04 12:25:35 -0500
commit5a6894397a657edec5d0cf4e20968cc66a368c51 (patch)
tree8c3329a5f32d195b2b9161b72000f619c35a804d
parent09a788624dbe32aeeb0d74c97c0965303eb96d8c (diff)
downloadu-boot-imx-5a6894397a657edec5d0cf4e20968cc66a368c51.zip
u-boot-imx-5a6894397a657edec5d0cf4e20968cc66a368c51.tar.gz
u-boot-imx-5a6894397a657edec5d0cf4e20968cc66a368c51.tar.bz2
common: env: initialize scalar variable
Before calling hsearch_r, initialize callback entry to NULL. Coverity log: " Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value e. Field e.callback is uninitialized when calling hsearch_r. " Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
-rw-r--r--common/env_callback.c1
-rw-r--r--common/env_flags.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/common/env_callback.c b/common/env_callback.c
index f4d3dbd..1957cc1 100644
--- a/common/env_callback.c
+++ b/common/env_callback.c
@@ -97,6 +97,7 @@ static int set_callback(const char *name, const char *value, void *priv)
e.key = name;
e.data = NULL;
+ e.callback = NULL;
hsearch_r(e, FIND, &ep, &env_htab, 0);
/* does the env variable actually exist? */
diff --git a/common/env_flags.c b/common/env_flags.c
index e682d85..7719355 100644
--- a/common/env_flags.c
+++ b/common/env_flags.c
@@ -455,6 +455,7 @@ static int set_flags(const char *name, const char *value, void *priv)
e.key = name;
e.data = NULL;
+ e.callback = NULL;
hsearch_r(e, FIND, &ep, &env_htab, 0);
/* does the env variable actually exist? */