ALSA: PCM: Fix some races at disconnection
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Nov 2012 11:39:51 +0000 (12:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Nov 2012 21:16:12 +0000 (13:16 -0800)
commit5fee99c200f8138f3eb1cd6b3d69b199b3d86686
tree45b03888c0971b907faef020449efaea078a8ede
parent45820dcb6cfe07b7ebb6ae5a5688f06b83996478
ALSA: PCM: Fix some races at disconnection

commit 9b0573c07f278e9888c352aa9724035c75784ea0 upstream.

Fix races at PCM disconnection:
- while a PCM device is being opened or closed
- while the PCM state is being changed without lock in prepare,
  hw_params, hw_free ops

Reported-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm.c
sound/core/pcm_native.c