Skip to content

Commit a968373

Browse files
kcxtbroonie
authored andcommitted
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: 4e01e5d ("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>
1 parent 53f3a90 commit a968373

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sound/soc/soc-core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,12 +1863,15 @@ static void cleanup_dmi_name(char *name)
18631863

18641864
/*
18651865
* Check if a DMI field is valid, i.e. not containing any string
1866-
* in the black list.
1866+
* in the black list and not the empty string.
18671867
*/
18681868
static int is_dmi_valid(const char *field)
18691869
{
18701870
int i = 0;
18711871

1872+
if (!field[0])
1873+
return 0;
1874+
18721875
while (dmi_blacklist[i]) {
18731876
if (strstr(field, dmi_blacklist[i]))
18741877
return 0;

0 commit comments

Comments
 (0)