diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-30 15:45:17 -0700 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2016-02-06 13:57:15 +0100 |
commit | a108082d4db959544c4340ced7dcdb45ec3679da (patch) | |
tree | 5e529eadeb743bd41ae0da35e205da96f2126509 | |
parent | 2b80b4e246e4f20aec84c15e4da229d07a4c6fad (diff) | |
download | u-boot-imx-a108082d4db959544c4340ced7dcdb45ec3679da.zip u-boot-imx-a108082d4db959544c4340ced7dcdb45ec3679da.tar.gz u-boot-imx-a108082d4db959544c4340ced7dcdb45ec3679da.tar.bz2 |
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>
-rw-r--r-- | test/dm/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dm/video.c b/test/dm/video.c index de22328..4d000fa 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -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; |