mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-04 14:10:46 +00:00
ALSA: emux: Fix mutex deadlock at unloading
The emux-synth driver has a possible AB/BA mutex deadlock at unloading the emu10k1 driver: snd_emux_free() -> snd_emux_detach_seq(): mutex_lock(&emu->register_mutex) -> snd_seq_delete_kernel_client() -> snd_seq_free_client(): mutex_lock(®ister_mutex) snd_seq_release() -> snd_seq_free_client(): mutex_lock(®ister_mutex) -> snd_seq_delete_all_ports() -> snd_emux_unuse(): mutex_lock(&emu->register_mutex) Basically snd_emux_detach_seq() doesn't need a protection of emu->register_mutex as it's already being unregistered. So, we can get rid of this for avoiding the deadlock. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d02260824e
commit
07b0e5d49d
@ -124,12 +124,10 @@ snd_emux_detach_seq(struct snd_emux *emu)
|
|||||||
if (emu->voices)
|
if (emu->voices)
|
||||||
snd_emux_terminate_all(emu);
|
snd_emux_terminate_all(emu);
|
||||||
|
|
||||||
mutex_lock(&emu->register_mutex);
|
|
||||||
if (emu->client >= 0) {
|
if (emu->client >= 0) {
|
||||||
snd_seq_delete_kernel_client(emu->client);
|
snd_seq_delete_kernel_client(emu->client);
|
||||||
emu->client = -1;
|
emu->client = -1;
|
||||||
}
|
}
|
||||||
mutex_unlock(&emu->register_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user