1
0
Fork 0

video: test: Adjust order of file closure

Close the file earlier to hopefully fix a Coverity error.

Reported-by: Coverity (CID: 134901)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
utp
Simon Glass 2016-01-30 15:45:17 -07:00 committed by Anatolij Gustschin
parent 2b80b4e246
commit a108082d4d
1 changed files with 1 additions and 1 deletions

View File

@ -249,9 +249,9 @@ static int read_file(struct unit_test_state *uts, const char *fname,
fd = os_open(fname, OS_O_RDONLY);
ut_assert(fd >= 0);
size = os_read(fd, buf, buf_size);
os_close(fd);
ut_assert(size >= 0);
ut_assert(size < buf_size);
os_close(fd);
*addrp = addr;
return 0;