Skip to content

Commit

Permalink
ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume
Browse files Browse the repository at this point in the history
In commit 411cef6 ("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: 411cef6 ("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>
  • Loading branch information
Pavel Skripkin authored and Takashi Iwai committed Oct 26, 2021
1 parent 5fc462c commit 3ab7992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/oss/mixer_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3ab7992

Please sign in to comment.