ASoC: detect empty DMI strings

Some bootloaders like recent versions of U-Boot may install some DMI
properties with empty values rather than not populate them. This manages
to make its way through the validator and cleanup resulting in a rogue
hyphen being appended to the card longname.

Fixes: 4e01e5dbba ("ASoC: improve the DMI long card code in asoc-core")
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://patch.msgid.link/20260306174707.283071-2-casey.connolly@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Casey Connolly
2026-03-06 18:47:07 +01:00
committed by Mark Brown
parent 53f3a900e9
commit a9683730e8

View File

@@ -1863,12 +1863,15 @@ static void cleanup_dmi_name(char *name)
/*
* Check if a DMI field is valid, i.e. not containing any string
* in the black list.
* in the black list and not the empty string.
*/
static int is_dmi_valid(const char *field)
{
int i = 0;
if (!field[0])
return 0;
while (dmi_blacklist[i]) {
if (strstr(field, dmi_blacklist[i]))
return 0;