From: Simon Glass Date: Sat, 30 Jan 2016 22:45:17 +0000 (-0700) Subject: video: test: Adjust order of file closure X-Git-Tag: v2016.03-rc2~92^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a108082d4db959544c4340ced7dcdb45ec3679da;p=oweals%2Fu-boot.git 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 Reviewed-by: Tom Rini --- diff --git a/test/dm/video.c b/test/dm/video.c index de223281b4..4d000fa1be 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;