public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Mattias Hansson <hansson.mattias@gmail.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH v2] tools/mxsimage: Remove fclose on empty FILE pointer
Date: Wed, 24 Nov 2021 13:22:26 +0100	[thread overview]
Message-ID: <2820371.1637756546@gemini.denx.de> (raw)
In-Reply-To: <20211124121049.24054-1-hansson.mattias@gmail.com>

Dear Mattias Hansson,

In message <20211124121049.24054-1-hansson.mattias@gmail.com> you wrote:
> 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>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Time is a drug. Too much of it kills you.
                                      - Terry Pratchett, _Small Gods_

  reply	other threads:[~2021-11-24 12:22 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 [this message]
2022-02-05 16:38 ` sbabic

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=2820371.1637756546@gemini.denx.de \
    --to=wd@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