mb/google/brox: Handle NULL return value in variant_get_auxfw_version_file

When bundled fw is NULL the system boot hangs.
Add a judgement to return mismatch when bundled fw is NULL.

BUG=b:434844512
BRANCH=firmware-brox-16080.B
TEST=emerge-brox coreboot
     set FW_CONFIG=STORAGE_NVME and DUT can boot into OS

Change-Id: Ibe81e944725b8c387c61451c2e422d57f7aeb8c1
Signed-off-by: Tony Huang <tony-huang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Tony Huang 2025-07-30 08:36:16 +08:00 committed by Jon Murphy
commit 0f84878c89

View file

@ -30,6 +30,10 @@ static bool check_auxfw_ver_mismatch(void)
cur_major_ver = (pd_chip_r.fw_version_number >> 16) & 0xFF;
is_productionfw = !!(cur_major_ver & 0xF0);
/* check whether bundled fw is NULL */
if (!fwver_fname)
return mismatch;
/* find bundled fw hash */
new_ver = cbfs_map(fwver_fname, &new_ver_size);
if (new_ver == NULL || new_ver_size != FWVER_SIZE)