* [PATCH] ASoC: Intel: atom: Fix double unlock in sst_register_dsp()
@ 2026-11-29 7:27 Arina Kharlamova via B4 Relay
2026-11-30 12:02 ` Cezary Rojewski
0 siblings, 1 reply; 2+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-11-29 7:27 UTC (permalink / raw)
To: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
Kai Vehmanen, Pierre-Louis Bossart, Mark Brown, Jaroslav Kysela,
Takashi Iwai, bui duc phuc
Cc: linux-sound, stable, Arina Kharlamova
From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
Commit 71c0f725d35d ("ASoC: Intel: atom: Use guard() for locking")
replaced the mutex_lock()/mutex_unlock() pair in sst_register_dsp()
with guard(mutex), but left the explicit mutex_unlock() on the -EEXIST
path. When a DSP is already registered, sst_lock is now released twice:
once by hand and once when the guard goes out of scope.
Drop the explicit unlock and let the guard release the mutex.
Fixes: 71c0f725d35d ("ASoC: Intel: atom: Use guard() for locking")
Cc: stable@vger.kernel.org
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
Found by checks derived from the spec2patch kernel API specifications,
with the help of an AI coding assistant (Claude); I reviewed the
analysis and the fix.
---
sound/soc/intel/atom/sst-mfld-platform-pcm.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 8c0e4c1d0c0c..bbd43d1b5bfa 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -37,7 +37,6 @@ int sst_register_dsp(struct sst_device *dev)
if (sst) {
dev_err(dev->dev, "we already have a device %s\n", sst->name);
module_put(dev->dev->driver->owner);
- mutex_unlock(&sst_lock);
return -EEXIST;
}
dev_dbg(dev->dev, "registering device %s\n", dev->name);
---
base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
change-id: 20261129-s2p-c01-aced22f2c550
Best regards,
--
Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Intel: atom: Fix double unlock in sst_register_dsp()
2026-11-29 7:27 [PATCH] ASoC: Intel: atom: Fix double unlock in sst_register_dsp() Arina Kharlamova via B4 Relay
@ 2026-11-30 12:02 ` Cezary Rojewski
0 siblings, 0 replies; 2+ messages in thread
From: Cezary Rojewski @ 2026-11-30 12:02 UTC (permalink / raw)
To: arina.kharlamova
Cc: linux-sound, stable, Liam Girdwood, Peter Ujfalusi, Bard Liao,
Kai Vehmanen, Pierre-Louis Bossart, Mark Brown, Jaroslav Kysela,
Takashi Iwai, bui duc phuc
On 11/29/2026 8:27 AM, Arina Kharlamova via B4 Relay wrote:
> From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
>
> Commit 71c0f725d35d ("ASoC: Intel: atom: Use guard() for locking")
> replaced the mutex_lock()/mutex_unlock() pair in sst_register_dsp()
> with guard(mutex), but left the explicit mutex_unlock() on the -EEXIST
> path. When a DSP is already registered, sst_lock is now released twice:
> once by hand and once when the guard goes out of scope.
>
> Drop the explicit unlock and let the guard release the mutex.
>
> Fixes: 71c0f725d35d ("ASoC: Intel: atom: Use guard() for locking")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
Thank you for the fix.
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-30 12:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 7:27 [PATCH] ASoC: Intel: atom: Fix double unlock in sst_register_dsp() Arina Kharlamova via B4 Relay
2026-11-30 12:02 ` Cezary Rojewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox