ALSA: usb - Release capture substream URBs properly
authorTakashi Iwai <tiwai@suse.de>
Wed, 8 Sep 2010 06:27:02 +0000 (08:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Sep 2010 06:27:02 +0000 (08:27 +0200)
Due to the wrong "return" in the loop, a capture substream won't be
released at disconnection properly if the device is capture only and has
no playback substream.  This caused Oops occasionally at the device
reconnection.

Reported-by: Kim Minhyoung <minhyoung.kim@lge.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c

index 32e4be8a187c5d7b84559ec790e04d4ab58258dd..4eabafa5b037db66b250db64cc0ce05aa783f595 100644 (file)
@@ -126,7 +126,7 @@ static void snd_usb_stream_disconnect(struct list_head *head)
        for (idx = 0; idx < 2; idx++) {
                subs = &as->substream[idx];
                if (!subs->num_formats)
-                       return;
+                       continue;
                snd_usb_release_substream_urbs(subs, 1);
                subs->interface = -1;
        }