Eric Lai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63772 )
Change subject: ec/google/chromeec: Add empty string check for OEM string ......................................................................
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 --- M src/ec/google/chromeec/ec_smbios.c 1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/63772/1
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; }