From: Simon Glass Date: Fri, 14 May 2021 01:39:30 +0000 (-0600) Subject: sandbox: Silence coverity warning in state_read_file() X-Git-Url: http://git.dujemihanovic.xyz/html/static/gitweb.css?a=commitdiff_plain;h=9a72bea6cbb14f196acc6422d6f5b1eefb590a61;p=u-boot.git 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 Reported-by: Coverity (CID: 165109) --- diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index f63cfd38ee..a4d99bade4 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;