]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: usb-audio - Avoid Oops after disconnect
authorTakashi Iwai <tiwai@suse.de>
Mon, 28 Dec 2009 11:24:22 +0000 (12:24 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:55:31 +0000 (15:55 -0700)
commit 78b8d5d2ee280c463908fd75f3bdf246bcb6ac8d upstream.

As the release of substreams may be done asynchronously from the
disconnection, close callback needs to check the shutdown flag before
actually accessing the usb interface.

Reference: Novell bnc#505027
http://bugzilla.novell.com/show_bug.cgi?id=565027

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/usb/usbaudio.c

index b70527a92b01587aefb7ee59ac9e648b6203d7b4..8da53c56c4d280764c21daf0153200e508a2bd4b 100644 (file)
@@ -1934,7 +1934,7 @@ static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction)
        struct snd_usb_stream *as = snd_pcm_substream_chip(substream);
        struct snd_usb_substream *subs = &as->substream[direction];
 
-       if (subs->interface >= 0) {
+       if (!as->chip->shutdown && subs->interface >= 0) {
                usb_set_interface(subs->dev, subs->interface, 0);
                subs->interface = -1;
        }