Skip to content
Commit 741d1e9d authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

bootstd: Avoid freeing a non-allocated buffer



EFI applications can be very large and thus used to cause boot failures
when malloc() space was exhausted.

A recent changed fixed this by using the kernel_addr_r environment var
as the address of the buffer. However, it still frees the buffer when
the bootflow is discarded.

Fix this by introducing a flag to indicate whether the buffer was
allocated, or not.

Note that kernel_addr_r is not the last word here. It might be better
to use lmb to place images. But there is a lot of refactoring to do
before we can remove the environment variables. The distro scripts rely
on them so it is safe for bootstd to do so too.

Fixes: 6a8c2f97 bootstd: Avoid allocating memory for the EFI file

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reported by: Simon Glass <sjg@chromium.org>
Reported by: Shantur Rathore <i@shantur.com>
Reviewed-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: default avatarShantur Rathore <i@shantur.com>
parent 169c3cc4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment