[PATCH 1/2] ALSA: usb-audio: Ignore trailing whitespace in quirk_flags

From: chris

Date: Fri Nov 20 2026 - 07:05:03 EST


Writing a flag name to the quirk_flags module parameter through sysfs
with echo leaves a trailing newline on the string. The parser keeps it
as part of the last flag name, so a valid flag is rejected:

snd_usb_audio: unknown flag SKIP_IFACE_SETUP
while parsing param quirk_flags

Numeric flags are not affected because kstrtou64() accepts a trailing
newline. Strip leading and trailing whitespace before parsing.

Fixes: ffd586126a82 ("ALSA: usb-audio: improve module param quirk_flags")
Assisted-by: AI
Signed-off-by: Christopher Snowhill <chris@xxxxxxxxxx>
---
sound/usb/quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a54fabce7920..cff10fac496f 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2765,7 +2765,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
if (!val)
return;

- for (p = val; p && *p;) {
+ for (p = strim(val); p && *p;) {
/* Each entry consists of VID:PID:flags */
field = strsep(&p, ":");
if (!field)
--
2.56.0