]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: rawmidi: Take buffer refcount while draining output
authorTakashi Iwai <tiwai@suse.de>
Fri, 17 Jun 2022 14:40:51 +0000 (16:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 20 Jun 2022 07:36:04 +0000 (09:36 +0200)
commit7e9b73732f643b63f871ff9a5c9875c58f401216
treefb9389ce3a0176649992bdde86080f5a218df71d
parent75433219672c1ea686fdb786173bd86a1c4c4b33
ALSA: rawmidi: Take buffer refcount while draining output

Although snd_rawmidi_drain_output() may take some long time, it has no
protection and intrusive operations like the buffer resize may happen
meanwhile.  For making the operation a bit more robust, this patch
takes the buffer refcount for blocking the buffer resize.

Also, as this function is exported, in theory, it might be called
asynchronously from the stream open/close state.  For avoiding the
missing refcount, now the close call checks the buffer refcount, too.

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