diff mbox series

[V4] delta_handler: fix coverity

Message ID 20230327084944.107936-1-sbabic@denx.de
State Accepted
Headers show
Series [V4] delta_handler: fix coverity | expand

Commit Message

Stefano Babic March 27, 2023, 8:49 a.m. UTC
This fixes: "Argoment cannot be negativ"
	#343301
	#451058
	#343302

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 handlers/delta_handler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dominique MARTINET March 27, 2023, 11:22 p.m. UTC | #1
Thanks for v4!

Stefano Babic wrote on Mon, Mar 27, 2023 at 10:49:44AM +0200:
> This fixes: "Argoment cannot be negativ"

(If I were to nitpick, I'm sure that's "Argument cannot be
negative"... Probably doesn't warrant a v5 though, feel free to fix as
you apply unless that's really the words coverity uses)

> 	#343301
> 	#451058
> 	#343302
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>

Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
diff mbox series

Patch

diff --git a/handlers/delta_handler.c b/handlers/delta_handler.c
index e078157..4ce49ff 100644
--- a/handlers/delta_handler.c
+++ b/handlers/delta_handler.c
@@ -1095,9 +1095,9 @@  static int install_delta(struct img_type *img,
 cleanup:
 	if (zckSrc) zck_free(&zckSrc);
 	if (zckDst) zck_free(&zckDst);
-	close(dst_fd);
-	close(in_fd);
-	close(mem_fd);
+	if (dst_fd >= 0) close(dst_fd);
+	if (in_fd >= 0) close(in_fd);
+	if (mem_fd >= 0) close(mem_fd);
 	if (FIFO) {
 		unlink(FIFO);
 		free(FIFO);