mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:
@ -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? */
|
||||
|
@ -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? */
|
||||
|
Reference in New Issue
Block a user