]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:23:50 +0000 (14:23 +0100)
commit0b54b16322e9b8a7b3897ce5c94b7ffef69c5ff4
tree122dbf9b962d99f943e05ef3689935038f3c1589
parentf6d9522d939cb63353f2bedd38d508aca335a503
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()

BugLink: https://bugs.launchpad.net/bugs/1996825
commit a70aef7982b012e86dfd39fbb235e76a21ae778a 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
sound/core/rawmidi.c