]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitdbd63343b8f81733fcfe5b2a1bf83e1669522a91
treefaa2d09d3e38c6e778df9ce454d3b119961bf764
parent2cc460d8f034b7edd24c09a8386e776e277a1f51
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