[PATCH] tools/mxsimage: Remove fclose on empty FILE pointer

Fabio Estevam festevam at gmail.com
Tue Nov 23 20:12:36 CET 2021


Hi Mattias,

On Tue, Nov 23, 2021 at 4:10 PM Mattias Hansson
<hansson.mattias at gmail.com> 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 `fclose()` since `fopen()` always returns NULL
> instead of the file descriptor when failing.

You missed your Signed-off-line tag.


More information about the U-Boot mailing list