]> git.itanic.dy.fi Git - linux-stable/commitdiff
ALSA: usb-audio: Register card again for iface over delayed_register option
authorTakashi Iwai <tiwai@suse.de>
Wed, 31 Aug 2022 12:59:01 +0000 (14:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:32:05 +0000 (11:32 +0200)
[ Upstream commit 2027f114686e0f3f1f39971964dfc618637c88c2 ]

When the delayed registration is specified via either delayed_register
option or the quirk, we delay the invocation of snd_card_register()
until the given interface.  But if a wrong value has been set there
and there are more interfaces over the given interface number,
snd_card_register() call would be missing for those interfaces.

This patch catches up those missing calls by fixing the comparison of
the interface number.  Now the call is skipped only if the processed
interface is less than the given interface, instead of the exact
match.

Fixes: b70038ef4fea ("ALSA: usb-audio: Add delayed_register option")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216082
Link: https://lore.kernel.org/r/20220831125901.4660-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/card.c
sound/usb/quirks.c

index a3e06a71cf356719f99c80381c07a5502c4c2d5d..6b172db58a31011a593ee6e1a61a9d0a12610db1 100644 (file)
@@ -667,7 +667,7 @@ static bool check_delayed_register_option(struct snd_usb_audio *chip, int iface)
                if (delayed_register[i] &&
                    sscanf(delayed_register[i], "%x:%x", &id, &inum) == 2 &&
                    id == chip->usb_id)
-                       return inum != iface;
+                       return iface < inum;
        }
 
        return false;
index 6333a2ecb848aa4600b1c89d67a3c9ab545fb650..41f5d8242478fdcdf68f60f0f941264c92b2954a 100644 (file)
@@ -1911,7 +1911,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface)
 
        for (q = registration_quirks; q->usb_id; q++)
                if (chip->usb_id == q->usb_id)
-                       return iface != q->interface;
+                       return iface < q->interface;
 
        /* Register as normal */
        return false;