Skip to content
Snippets Groups Projects
Commit f80a8bbe authored by Simon Glass's avatar Simon Glass
Browse files

sandbox: Fix warnings in cpu.c and os.c


This fixes the following two problems:

cppcheck reports:
[arch/sandbox/cpu/start.c:132]: (error) Uninitialized variable: err
[arch/sandbox/cpu/os.c:371]: (error) Memory leak: fname

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reported-by: default avatarWolfgang Denk <wd@denx.de>
parent e48f3741
No related branches found
No related tags found
No related merge requests found
......@@ -367,6 +367,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
done:
closedir(dir);
free(fname);
return ret;
}
......
......@@ -130,7 +130,8 @@ static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
state->write_ram_buf = true;
state->ram_buf_fname = arg;
if (os_read_ram_buf(arg)) {
err = os_read_ram_buf(arg);
if (err) {
printf("Failed to read RAM buffer\n");
return err;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment