Skip to content

Commit

Permalink
ALSA: usb-audio: Fix last interface check for registration
Browse files Browse the repository at this point in the history
commit 39efc9c upstream.

The recent fix in commit 6392dcd ("ALSA: usb-audio: Register card
at the last interface") tried to delay the card registration until the
last found interface is probed.  It assumed that the probe callback
gets called for those later interfaces, but it's not always true; as
the driver loops over the descriptor and probes the matching ones,
it's not separately called via multiple probe calls.  This results in
the missing card registration, i.e. no sound device.

For addressing this problem, replace the check whether the last
interface is processed with usb_interface_claimed() instead of the
comparison with the probe interface number.

Fixes: 6392dcd ("ALSA: usb-audio: Register card at the last interface")
Link: https://lore.kernel.org/r/20220915085947.7922-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tiwai authored and gregkh committed Oct 21, 2022
1 parent 490fc4a commit 52076a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ static int usb_audio_probe(struct usb_interface *intf,
* one given via option
*/
if (check_delayed_register_option(chip) == ifnum ||
chip->last_iface == ifnum) {
usb_interface_claimed(usb_ifnum_to_if(dev, chip->last_iface))) {
err = snd_card_register(chip->card);
if (err < 0)
goto __error;
Expand Down

0 comments on commit 52076a4

Please sign in to comment.