projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdfae37
)
sandbox: Silence coverity warning in state_read_file()
author
Simon Glass
<sjg@chromium.org>
Fri, 14 May 2021 01:39:30 +0000
(19:39 -0600)
committer
Tom Rini
<trini@konsulko.com>
Thu, 15 Jul 2021 22:42:05 +0000
(18:42 -0400)
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)
arch/sandbox/cpu/state.c
patch
|
blob
|
history
diff --git
a/arch/sandbox/cpu/state.c
b/arch/sandbox/cpu/state.c
index f63cfd38ee40f001641001b55e03380ac9a2370c..a4d99bade41c3d9efe0f1ab816aada08657c20b1 100644
(file)
--- 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;