soc/intel/apollolake: Fix bitshift issue in bootblock
Fix issue where zero-sized BIOS region could cause bitshift for '-1' which is an unspecified behavior. Change-Id: Icb62bf413a1a0d293657503ef21fe97b5f9a5484 Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: https://review.coreboot.org/15727 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
b921725b52
commit
dc97b1ce2f
@ -100,6 +100,9 @@ static void cache_bios_region(void)
|
|||||||
/* Only the IFD BIOS region is memory mapped (at top of 4G) */
|
/* Only the IFD BIOS region is memory mapped (at top of 4G) */
|
||||||
rom_size = get_bios_size();
|
rom_size = get_bios_size();
|
||||||
|
|
||||||
|
if (!rom_size)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Round to power of two */
|
/* Round to power of two */
|
||||||
alignment = 1 << (log2_ceil(rom_size));
|
alignment = 1 << (log2_ceil(rom_size));
|
||||||
rom_size = ALIGN_UP(rom_size, alignment);
|
rom_size = ALIGN_UP(rom_size, alignment);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user