summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-30 15:45:17 -0700
committerAnatolij Gustschin <agust@denx.de>2016-02-06 13:57:15 +0100
commita108082d4db959544c4340ced7dcdb45ec3679da (patch)
tree5e529eadeb743bd41ae0da35e205da96f2126509 /test/dm
parent2b80b4e246e4f20aec84c15e4da229d07a4c6fad (diff)
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>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/video.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dm/video.c b/test/dm/video.c
index de223281b45..4d000fa1bea 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;