Skip to content
Commit a643375f authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Matt Fleming
Browse files

efi/libstub: Retrieve FDT size when loaded from UEFI config table



When allocating memory for the copy of the FDT that the stub
modifies and passes to the kernel, it uses the current size as
an estimate of how much memory to allocate, and increases it page
by page if it turns out to be too small. However, when loading
the FDT from a UEFI configuration table, the estimated size is
left at its default value of zero, and the allocation loop runs
starting from zero all the way up to the allocation size that
finally fits the updated FDT.

Instead, retrieve the size of the FDT from the FDT header when
loading it from the UEFI config table.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: default avatarRoy Franz <roy.franz@linaro.org>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent 744937b0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment