Commit 3ab79920 authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Takashi Iwai

ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume

In commit 411cef6a ("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: 411cef6a ("ALSA: mixer: oss: Fix racy access to slots")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20211024140315.16704-1-paskripkin@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5fc462c3
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment