All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: imx8image: Fix handle leak
@ 2022-11-23 10:59 Mikhail Ilin
  2022-11-25  4:01 ` Simon Glass
  2023-01-31  9:50 ` sbabic
  0 siblings, 2 replies; 3+ messages in thread
From: Mikhail Ilin @ 2022-11-23 10:59 UTC (permalink / raw)
  To: Peng Fan; +Cc: Mikhail Ilin, u-boot

 The handle "fd" was created in imx8image.c:249 by calling the "fopen"
 function and is lost in imx8image.c:282.
 Should close the 'fd' file descriptor before exiting the
 parse_cfg_file(image_t *param_stack, char *name) function.

Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support")
Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
---
 tools/imx8image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/imx8image.c b/tools/imx8image.c
index 01e1486911..395d5c64bd 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -279,6 +279,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
 		}
 	}
 
+	fclose(fd);
 	return 0;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools: imx8image: Fix handle leak
  2022-11-23 10:59 [PATCH] tools: imx8image: Fix handle leak Mikhail Ilin
@ 2022-11-25  4:01 ` Simon Glass
  2023-01-31  9:50 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-11-25  4:01 UTC (permalink / raw)
  To: Mikhail Ilin; +Cc: Peng Fan, u-boot

On Wed, 23 Nov 2022 at 04:00, Mikhail Ilin <ilin.mikhail.ol@gmail.com> wrote:
>
>  The handle "fd" was created in imx8image.c:249 by calling the "fopen"
>  function and is lost in imx8image.c:282.
>  Should close the 'fd' file descriptor before exiting the
>  parse_cfg_file(image_t *param_stack, char *name) function.
>
> Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support")
> Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
> ---
>  tools/imx8image.c | 1 +
>  1 file changed, 1 insertion(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] tools: imx8image: Fix handle leak
  2022-11-23 10:59 [PATCH] tools: imx8image: Fix handle leak Mikhail Ilin
  2022-11-25  4:01 ` Simon Glass
@ 2023-01-31  9:50 ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: sbabic @ 2023-01-31  9:50 UTC (permalink / raw)
  To: Mikhail Ilin, u-boot

> The handle "fd" was created in imx8image.c:249 by calling the "fopen"
>  function and is lost in imx8image.c:282.
>  Should close the 'fd' file descriptor before exiting the
>  parse_cfg_file(image_t *param_stack, char *name) function.
> Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support")
> Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter  
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-31  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 10:59 [PATCH] tools: imx8image: Fix handle leak Mikhail Ilin
2022-11-25  4:01 ` Simon Glass
2023-01-31  9:50 ` sbabic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.