ALSA: rawmidi: Move lock to snd_rawmidi_substream
authorTakashi Iwai <tiwai@suse.de>
Fri, 17 Jun 2022 14:40:48 +0000 (16:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Jun 2022 07:36:02 +0000 (09:36 +0200)
commitf1d40433352e5d4babd59c0dd50b5f9414073ddb
treefaa2d09d3e38c6e778df9ce454d3b119961bf764
parentcd76175a2b204911a3cddef36b99e56945b6938c
ALSA: rawmidi: Move lock to snd_rawmidi_substream

Having a lock in snd_rawmidi_runtime can be a problem especially when
a substream is accessed from the outside, as the runtime creation
might be racy with the external calls.  As a first step for hardening,
move the spinlock from snd_rawmidi_runtime to snd_rawmidi_substream.

This patch just replaces the lock calls, no real functional change is
put yet.

Link: https://lore.kernel.org/r/20220617144051.18985-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/rawmidi.h
sound/core/rawmidi.c