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 <eric_lai@quanta.corp-partner.google.com>
Change-Id: I097e1be696ae974aadc47feb8d0c1dae672a5c82
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63772
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
diff --git a/src/ec/google/chromeec/ec_smbios.c b/src/ec/google/chromeec/ec_smbios.c
index 0616c986..d804f64 100644
--- a/src/ec/google/chromeec/ec_smbios.c
+++ b/src/ec/google/chromeec/ec_smbios.c
@@ -27,13 +27,13 @@
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;
}