aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Skripkin <[email protected]>2021-10-24 17:03:15 +0300
committerTakashi Iwai <[email protected]>2021-10-26 07:59:40 +0200
commit3ab7992018455ac63c33e9b3eaa7264e293e40f4 (patch)
treef2d9dc3b2b27a8bdfa6b597d05717f20c0d2450b
parent5fc462c3aaad601d5089fd5588a5799896a6937d (diff)
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") Cc: <[email protected]> Signed-off-by: Pavel Skripkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
-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 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;
}