From 9c4d85d83af20b7e83ebcb577cd3566619abd545 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Tue, 2 Apr 2024 08:00:14 +0000 Subject: lib: Refactor bmp_load_logo() implementation This refactoring ensures bmp_load_logo() takes logo_size as an argument, returning a valid logo_ptr only if logo_size is non-zero. This prevents potential errors from mismatched size assumption. BUG=b:242829490 TEST=google/rex0 builds successfully. Change-Id: I14bc54670a67980ec93bc366b274832d1f959e50 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/81618 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Dinesh Gehlot Reviewed-by: Julius Werner --- src/soc/intel/apollolake/chip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/soc/intel/apollolake/chip.c') diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c index 91e39c9183..1d15eecc63 100644 --- a/src/soc/intel/apollolake/chip.c +++ b/src/soc/intel/apollolake/chip.c @@ -915,7 +915,9 @@ void mainboard_silicon_init_params(FSP_S_CONFIG *silconfig) /* Handle FSP logo params */ void soc_load_logo(FSPS_UPD *supd) { - bmp_load_logo(&supd->FspsConfig.LogoPtr, &supd->FspsConfig.LogoSize); + size_t logo_size; + supd->FspsConfig.LogoPtr = (uint32_t)(uintptr_t)bmp_load_logo(&logo_size); + supd->FspsConfig.LogoSize = (uint32_t)logo_size; } BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, spi_flash_init_cb, NULL); -- cgit v1.2.3