summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatteo.cotifava <cotifavamatteo@gmail.com>2026-03-09 22:54:11 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-19 16:14:52 +0100
commitd01282e28cccba5fb6ac0cc46e6b2c06c5f71847 (patch)
tree43560c50b911679265ac5f916268ec78b80128a9
parent85fb53351e6a3b921357a2178671e847a087e400 (diff)
ASoC: soc-core: drop delayed_work_pending() check before flush
[ Upstream commit 3c99c9f0ed60582c1c9852b685d78d5d3a50de63 ] The delayed_work_pending() check before flush_delayed_work() in soc_free_pcm_runtime() is unnecessary and racy. flush_delayed_work() is safe to call unconditionally - it is a no-op when no work is pending. Remove the check. The original check was added by commit 9c9b65203492 ("ASoC: core: only flush inited work during free") but delayed_work_pending() followed by flush_delayed_work() has a time-of-check/time-of-use window where work can become pending between the two calls. Fixes: 9c9b65203492 ("ASoC: core: only flush inited work during free") Signed-off-by: Matteo Cotifava <cotifavamatteo@gmail.com> Link: https://patch.msgid.link/20260309215412.545628-2-cotifavamatteo@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e4b21bf39e59..182d2272c2f3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -462,8 +462,7 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
list_del(&rtd->list);
- if (delayed_work_pending(&rtd->delayed_work))
- flush_delayed_work(&rtd->delayed_work);
+ flush_delayed_work(&rtd->delayed_work);
snd_soc_pcm_component_free(rtd);
/*