[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240709162224.31148-28-sashal@kernel.org>
Date: Tue, 9 Jul 2024 12:21:54 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Takashi Iwai <tiwai@...e.de>,
Sasha Levin <sashal@...nel.org>,
perex@...ex.cz,
tiwai@...e.com,
pavel.hofman@...tera.com,
dhowells@...hat.com,
cezary.rojewski@...el.com,
linux-sound@...r.kernel.org
Subject: [PATCH AUTOSEL 6.6 28/33] ALSA: PCM: Allow resume only for suspended streams
From: Takashi Iwai <tiwai@...e.de>
[ Upstream commit 1225675ca74c746f09211528588e83b3def1ff6a ]
snd_pcm_resume() should bail out if the stream isn't in a suspended
state. Otherwise it'd allow doubly resume.
Link: https://patch.msgid.link/20240624125443.27808-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
sound/core/pcm_native.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index bd9ddf412b465..cc21c483c4a57 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1783,6 +1783,8 @@ static int snd_pcm_pre_resume(struct snd_pcm_substream *substream,
snd_pcm_state_t state)
{
struct snd_pcm_runtime *runtime = substream->runtime;
+ if (runtime->state != SNDRV_PCM_STATE_SUSPENDED)
+ return -EBADFD;
if (!(runtime->info & SNDRV_PCM_INFO_RESUME))
return -ENOSYS;
runtime->trigger_master = substream;
--
2.43.0
Powered by blists - more mailing lists