ALSA: usb-audio: Fix crash at re-preparing the PCM stream
authorTakashi Iwai <tiwai@suse.de>
Tue, 20 Nov 2012 07:20:02 +0000 (08:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 20:14:19 +0000 (12:14 -0800)
commite01d83515635e7176cb69f1ac2c59ad1e39e8a63
treef15b012f9de86cbe43dbd33d1385ec766c9ce0b2
parent347bd4501eec64db816bcd2438e38784f0107041
ALSA: usb-audio: Fix crash at re-preparing the PCM stream

commit f58161ba1b05a968e5136824b5a16b714b6a5317 upstream.

There are bug reports of a crash with USB-audio devices when PCM
prepare is performed immediately after the stream is stopped via
trigger callback.  It turned out that the problem is that we don't
wait until all URBs are killed.

This patch adds a new function to synchronize the pending stop
operation on an endpoint, and calls in the prepare callback for
avoiding the crash above.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=49181

Reported-and-tested-by: Artem S. Tashkinov <t.artem@lycos.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/endpoint.c
sound/usb/endpoint.h
sound/usb/pcm.c