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: NArd Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: NRoy Franz <roy.franz@linaro.org> Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
Showing
想要评论请 注册 或 登录