From c3e4f6700586245d009937c44c78b3d9614785b7 Mon Sep 17 00:00:00 2001 From: Eric Lai Date: Fri, 22 Apr 2022 11:00:15 +0800 Subject: ec/google/chromeec: Add empty string check for OEM string If set OEM string as "", it shows "Not Specified" with dmidecode. Use default string if it is empty. BUG=b:230039300 TEST=set OEM string "" and show google with dmidecode -t 2. Signed-off-by: Eric Lai Change-Id: I097e1be696ae974aadc47feb8d0c1dae672a5c82 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63772 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Henry Sun Reviewed-by: Tim Wawrzynczak Reviewed-by: Kangheui Won --- src/ec/google/chromeec/ec_smbios.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ec') diff --git a/src/ec/google/chromeec/ec_smbios.c b/src/ec/google/chromeec/ec_smbios.c index 0616c98685..d804f6431c 100644 --- a/src/ec/google/chromeec/ec_smbios.c +++ b/src/ec/google/chromeec/ec_smbios.c @@ -27,13 +27,13 @@ const char *smbios_mainboard_manufacturer(void) if (manuf) return manuf; - if (google_chromeec_cbi_get_oem_name(&oem_name[0], - ARRAY_SIZE(oem_name)) < 0) { + manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; + if (google_chromeec_cbi_get_oem_name(&oem_name[0], ARRAY_SIZE(oem_name)) < 0) printk(BIOS_INFO, "Couldn't obtain OEM name from CBI\n"); - manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; - } else { + else if (strlen(oem_name) > 0) manuf = &oem_name[0]; - } + else + printk(BIOS_INFO, "OEM name from CBI is empty, use default\n"); return manuf; } -- cgit v1.2.3