aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/emu10k1
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-28 17:11:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-13 05:15:41 -0700
commitc542e91572c54d2127ab3da723a922893fef1fb6 (patch)
tree9bbe97a3c7c9cabce7fe14daa57a06ab9d8929d0 /sound/pci/emu10k1
parentc19e77907dc450c69028c03c4058e5a5688ab2a9 (diff)
ALSA: emux: Fix mutex deadlock in OSS emulation
commit 1c94e65c668f44d2c69ae7e7fc268ab3268fba3e upstream. The OSS emulation in synth-emux helper has a potential AB/BA deadlock at the simultaneous closing and opening: close -> snd_seq_release() -> sne_seq_free_client() -> snd_seq_delete_all_ports(): takes client->ports_mutex -> port_delete() -> snd_emux_unuse(): takes emux->register_mutex open -> snd_seq_oss_open() -> snd_emux_open_seq_oss(): takes emux->register_mutex -> snd_seq_event_port_attach() -> snd_seq_create_port(): takes client->ports_mutex This patch addresses the deadlock by reducing the rance taking emux->register_mutex in snd_emux_open_seq_oss(). The lock is needed for the refcount handling, so move it locally. The calls in emux_seq.c are already with the mutex, thus they are replaced with the version without mutex lock/unlock. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/emu10k1')
0 files changed, 0 insertions, 0 deletions