[U-Boot] [PATCH 1/1] common: env: initialize scalar variable
Peng Fan
van.freenix at gmail.com
Tue Dec 22 10:14:14 CET 2015
From: Peng Fan <peng.fan at nxp.com>
Before calling hsearch_r, initialize callback entry to NULL.
Signed-off-by: Peng Fan <peng.fan at nxp.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: Simon Glass <sjg at chromium.org>
---
common/env_callback.c | 1 +
common/env_flags.c | 1 +
2 files changed, 2 insertions(+)
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? */
--
2.6.2
More information about the U-Boot
mailing list