aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-05-13 19:39:30 -0600
committerTom Rini <trini@konsulko.com>2021-07-15 18:42:05 -0400
commit9a72bea6cbb14f196acc6422d6f5b1eefb590a61 (patch)
treec6dae2b17f4ae13abd1397007b02233c2c0d0838 /arch/sandbox
parentfdfae3727ce2d862c5b7d98106c987202d190712 (diff)
downloadu-boot-9a72bea6cbb14f196acc6422d6f5b1eefb590a61.zip
u-boot-9a72bea6cbb14f196acc6422d6f5b1eefb590a61.tar.gz
u-boot-9a72bea6cbb14f196acc6422d6f5b1eefb590a61.tar.bz2
sandbox: Silence coverity warning in state_read_file()
In this case the value seems save to pass to os_free(). Add a comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 165109)
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index f63cfd3..a4d99ba 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -78,6 +78,10 @@ static int state_read_file(struct sandbox_state *state, const char *fname)
err_read:
os_close(fd);
err_open:
+ /*
+ * tainted scalar, since size is obtained from the file. But we can rely
+ * on os_malloc() to handle invalid values.
+ */
os_free(state->state_fdt);
state->state_fdt = NULL;