]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: detect empty DMI strings
authorCasey Connolly <casey.connolly@linaro.org>
Fri, 6 Mar 2026 17:47:07 +0000 (18:47 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 11 Mar 2026 15:28:35 +0000 (15:28 +0000)
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: 4e01e5dbba96 ("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>
sound/soc/soc-core.c

index cf826c2a8b5933e8282d7f839bbccd1b4a8d631a..573693e21780aa1b85ba7a39f7ded2406e167bea 100644 (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;