public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: sbabic@denx.de
To: Mattias Hansson <hansson.mattias@gmail.com>,u-boot@lists.denx.de
Subject: [PATCH v2] tools/mxsimage: Remove fclose on empty FILE pointer
Date: Sat,  5 Feb 2022 17:38:59 +0100 (CET)	[thread overview]
Message-ID: <20220205163902.2EC9683AA4@phobos.denx.de> (raw)
In-Reply-To: <20211124121049.24054-1-hansson.mattias@gmail.com>

> If `sb_load_cmdfile()` fails to open the configuration file it will jump
> to error handling where the code will try to `fclose()` the FILE pointer
> which is NULL causing `mkimage` to segfault.
> This patch removes the label for error handling and instead returns
> immediately which skips the `fclose()` and prevents the segfault. The
> errno is also described in the error message to guide users.
> Signed-off-by: Mattias Hansson <hansson.mattias@gmail.com>
> Reviewed-by: Wolfgang Denk <wd@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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

      parent reply	other threads:[~2022-02-05 16:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 12:10 [PATCH v2] tools/mxsimage: Remove fclose on empty FILE pointer Mattias Hansson
2021-11-24 12:22 ` Wolfgang Denk
2022-02-05 16:38 ` sbabic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220205163902.2EC9683AA4@phobos.denx.de \
    --to=sbabic@denx.de \
    --cc=hansson.mattias@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox