]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Add stream lock during PCM reset ioctl operations
authorTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2022 17:13:25 +0000 (18:13 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Mar 2022 19:57:15 +0000 (20:57 +0100)
commit4d01a50fa9d696396f15299d972efdddc5522df2
tree8ecc866b1820296c074e8a6d1bc8231d944b8c8d
parent2fa4a86698a2484836835f91f7796b6129def655
ALSA: pcm: Add stream lock during PCM reset ioctl operations

snd_pcm_reset() is a non-atomic operation, and it's allowed to run
during the PCM stream running.  It implies that the manipulation of
hw_ptr and other parameters might be racy.

This patch adds the PCM stream lock at appropriate places in
snd_pcm_*_reset() actions for covering that.

Cc: <stable@vger.kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220322171325.4355-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c