[PATCH] bootstd: Avoid freeing a non-allocated buffer
Tom Rini
trini at konsulko.com
Fri Nov 17 20:42:30 CET 2023
On Wed, Nov 15, 2023 at 06:35:23PM -0700, Simon Glass wrote:
> 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: 6a8c2f9781c bootstd: Avoid allocating memory for the EFI file
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reported by: Simon Glass <sjg at chromium.org>
> Reported by: Shantur Rathore <i at shantur.com>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Tested-by: Shantur Rathore <i at shantur.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231117/d2bc8c93/attachment.sig>
More information about the U-Boot
mailing list