Skip to content

Commit a70aef7

Browse files
committed
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
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: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 4f2e56a commit a70aef7

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

sound/core/rawmidi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,10 +1899,8 @@ static int snd_rawmidi_free(struct snd_rawmidi *rmidi)
18991899

19001900
snd_info_free_entry(rmidi->proc_entry);
19011901
rmidi->proc_entry = NULL;
1902-
mutex_lock(&register_mutex);
19031902
if (rmidi->ops && rmidi->ops->dev_unregister)
19041903
rmidi->ops->dev_unregister(rmidi);
1905-
mutex_unlock(&register_mutex);
19061904

19071905
snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]);
19081906
snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]);

0 commit comments

Comments
 (0)