[PATCH] tools: fdtgrep: Fix handle leak

Simon Glass sjg at chromium.org
Fri Nov 25 05:01:47 CET 2022


On Wed, 23 Nov 2022 at 04:31, Mikhail Ilin <ilin.mikhail.ol at gmail.com> wrote:
>
>  The handle "fd" was created in fdtgrep.c:708 by calling the
>  "open" function and is lost in fdtgrep.c:716 and fdtgrep.c:723.
>  Close file descriptor 'fd' before exiting with an error from function
>  utilfdt_read_err_len(const char *filename, char **buffp, off_t *len).
>
> Fixes: 1043d0a0296a ("fdt: Add fdtgrep tool")
> Signed-off-by: Mikhail Ilin <ilin.mikhail.ol at gmail.com>
> ---
>  tools/fdtgrep.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>

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


More information about the U-Boot mailing list