alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume
@ 2021-10-24 14:03 Pavel Skripkin
  2021-10-26  6:00 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Skripkin @ 2021-10-24 14:03 UTC (permalink / raw)
  To: perex, tiwai, broonie, joe, lars
  Cc: Pavel Skripkin, alsa-devel, syzbot+ace149a75a9a0a399ac7, linux-kernel

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: syzbot+ace149a75a9a0a399ac7@syzkaller.appspotmail.com
Fixes: 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 sound/core/oss/mixer_oss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index d5ddc154a735..9620115cfdc0 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -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;
 }
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume
  2021-10-24 14:03 [PATCH next] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume Pavel Skripkin
@ 2021-10-26  6:00 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-10-26  6:00 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: alsa-devel, lars, syzbot+ace149a75a9a0a399ac7, linux-kernel,
	tiwai, broonie, joe

On Sun, 24 Oct 2021 16:03:15 +0200,
Pavel Skripkin wrote:
> 
> 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: syzbot+ace149a75a9a0a399ac7@syzkaller.appspotmail.com
> Fixes: 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots")
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>

Applied now, thanks!


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-26  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 14:03 [PATCH next] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume Pavel Skripkin
2021-10-26  6:00 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).