Skip to contentSkip to conversation

ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume

PATCH In review Pavel Skripkin 2 participants 2 messages Oct 24, 2021 – Oct 26, 2021 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume

In commit 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots") added mutex protection in snd_mixer_oss_set_volume(). Second mutex_lock() in same function looks like typo, fix it.

Reported-by [email protected]
Fixes 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots")
---
 sound/core/oss/mixer_oss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/oss/mixer_oss.c +1 -1
index d5ddc154a735..9620115cfdc0 100644
@@ -313,7 +313,7 @@ static int snd_mixer_oss_set_volume(struct snd_mixer_oss_file *fmixer,
 	pslot->volume[1] = right;
 	result = (left & 0xff) | ((right & 0xff) << 8);
  unlock:
-	mutex_lock(&mixer->reg_mutex);
+	mutex_unlock(&mixer->reg_mutex);
 	return result;
 }
 
Signature · 1 line
2.33.1
#1 lore raw
Quoted 8 lines · Pavel Skripkin

In commit 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots") added mutex protection in snd_mixer_oss_set_volume(). Second mutex_lock() in same function looks like typo, fix it.

Reported-by [email protected]
Fixes 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots")

Applied now, thanks!

Takashi