diff mbox

[U-Boot] fit_image: Fix a double close() on the error path

Message ID 1462144344-15226-1-git-send-email-sjg@chromium.org
State Accepted
Commit 4c1dc1a90fb60c2e5f28351b6ff2ae187dc587ef
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass May 1, 2016, 11:12 p.m. UTC
There is an extra close() call which is not needed.

Reported-by: Coverity (CID: 143065)
Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/fit_image.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Tom Rini May 2, 2016, 11:31 p.m. UTC | #1
On Sun, May 01, 2016 at 05:12:24PM -0600, Simon Glass wrote:

> There is an extra close() call which is not needed.
> 
> Reported-by: Coverity (CID: 143065)
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/fit_image.c b/tools/fit_image.c
index ddefa72..0551572 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -343,7 +343,6 @@  static int fit_build(struct image_tool_params *params, const char *fname)
 	if (ret != size) {
 		fprintf(stderr, "%s: Can't write %s: %s\n",
 			params->cmdname, fname, strerror(errno));
-		close(fd);
 		goto err;
 	}
 	close(fd);