diff options
| author | Casey Connolly <casey.connolly@linaro.org> | 2026-03-06 18:47:07 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-19 16:08:20 +0100 |
| commit | b3b56d60fee163fe2cf08ce933b07cd2b8d98736 (patch) | |
| tree | cb9b8b3bf4fa9b59b8b155f052aa12b8897cdb7a | |
| parent | 790851ecc983c719fa2e6adb17b02f3acc1d217d (diff) | |
ASoC: detect empty DMI strings
[ Upstream commit a9683730e8b1d632674f81844ed03ddfbe4821c0 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | sound/soc/soc-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 013437f845e0..7a6b4ec3a699 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1860,12 +1860,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; |
