]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
authorTakashi Iwai <tiwai@suse.de>
Tue, 11 Oct 2022 07:01:46 +0000 (09:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:10 +0000 (13:22 +0200)
commit008de71a6e0bf8efe0bae975650de63b6f912081
tree9c818467b567268517bf5ed56f8e1cd6853140aa
parent5e518603689328e792194b88427540a55ffaf7ee
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()

commit 1ffe62347996d2b5893ffcd246743f0f1e9cd46f upstream.

The register_mutex taken around the dev_unregister callback call in
snd_rawmidi_free() may potentially lead to a mutex deadlock, when OSS
emulation and a hot unplug are involved.

Since the mutex doesn't protect the actual race (as the registration
itself is already protected by another means), let's drop it.

Link: https://lore.kernel.org/r/CAB7eexJP7w1B0mVgDF0dQ+gWor7UdkiwPczmL7pn91xx8xpzOA@mail.gmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221011070147.7611-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/rawmidi.c