aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-28 06:24:22 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-28 06:24:22 -0500
commit78b8d5d2ee280c463908fd75f3bdf246bcb6ac8d (patch)
tree6919af56842f47f2a2b553b890320a9952c501b6 /sound/usb
parent9980c6209ebc2a02eb3ca51a4fae1e17f645c868 (diff)
ALSA: usb-audio - Avoid Oops after disconnect
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>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usbaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 4963defee18a..9edef4684978 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -1936,7 +1936,7 @@ static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction)
1936 struct snd_usb_stream *as = snd_pcm_substream_chip(substream); 1936 struct snd_usb_stream *as = snd_pcm_substream_chip(substream);
1937 struct snd_usb_substream *subs = &as->substream[direction]; 1937 struct snd_usb_substream *subs = &as->substream[direction];
1938 1938
1939 if (subs->interface >= 0) { 1939 if (!as->chip->shutdown && subs->interface >= 0) {
1940 usb_set_interface(subs->dev, subs->interface, 0); 1940 usb_set_interface(subs->dev, subs->interface, 0);
1941 subs->interface = -1; 1941 subs->interface = -1;
1942 } 1942 }