summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-10-24 17:03:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 11:58:36 +0100
commit43b81193ccb0d5c97f984817e0b690fbcaa7bc35 (patch)
treebf7db1e67be9e113c5043003e7a1ebb9e1817ad3
parentb3aa80f707eccfe35809d12403843488c9e006d2 (diff)
ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume
commit 3ab7992018455ac63c33e9b3eaa7264e293e40f4 upstream. 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") Cc: <stable@vger.kernel.org> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Link: https://lore.kernel.org/r/20211024140315.16704-1-paskripkin@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/core/oss/mixer_oss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 27bd37e25aff..903fbf03559e 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -327,7 +327,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;
}