mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-21 23:16:50 +08:00
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:
committed by
Mark Brown
parent
53f3a900e9
commit
a9683730e8
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user