]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()
authorpaulhsia <paulhsia@chromium.org>
Tue, 12 Nov 2019 17:17:14 +0000 (01:17 +0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:02 +0000 (14:22 -0300)
commitc334dc76ec4194ab5bb2d0d46bac8bee424dd27c
treea34e5508db06fe3eec61c113256e0c6c4ae9442a
parentb6db81ac0f3dc2fd0bdcbc8b23b9800dbaf97be6
ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()

BugLink: https://bugs.launchpad.net/bugs/1857158
[ Upstream commit f5cdc9d4003a2f66ea57b3edd3e04acc2b1a4439 ]

If the nullity check for `substream->runtime` is outside of the lock
region, it is possible to have a null runtime in the critical section
if snd_pcm_detach_substream is called right before the lock.

Signed-off-by: paulhsia <paulhsia@chromium.org>
Link: https://lore.kernel.org/r/20191112171715.128727-2-paulhsia@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
sound/core/pcm_lib.c