diff options
author | Peng Fan <peng.fan@nxp.com> | 2015-12-23 12:07:24 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@freescale.com> | 2016-03-04 15:53:38 +0800 |
commit | a15a650e05e1a0f5cfabcf61e20ff543df14f5c8 (patch) | |
tree | 1f0666d99e82128ee247206a87093e7654178f88 /common/env_callback.c | |
parent | fa76dda1e70e44292f0773d649eeb1df5553329a (diff) | |
download | u-boot-imx-a15a650e05e1a0f5cfabcf61e20ff543df14f5c8.zip u-boot-imx-a15a650e05e1a0f5cfabcf61e20ff543df14f5c8.tar.gz u-boot-imx-a15a650e05e1a0f5cfabcf61e20ff543df14f5c8.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>
(cherry picked from commit 5a6894397a657edec5d0cf4e20968cc66a368c51)
Diffstat (limited to 'common/env_callback.c')
-rw-r--r-- | common/env_callback.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/env_callback.c b/common/env_callback.c index d03fa03..7de88fb 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) e.key = name; e.data = NULL; + e.callback = NULL; hsearch_r(e, FIND, &ep, &env_htab, 0); /* does the env variable actually exist? */ |