summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2020-11-13 18:20:43 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-24 12:48:12 +0100
commit51b07e0fc822012e34653f99277bc4a9ecf27d31 (patch)
tree4bd7822abba0c7e9e091ab70d394889db43ce799 /sound
parentddedb548ba8501ecbe78f9f61292518745220a8d (diff)
downloadlinux-stable-51b07e0fc822012e34653f99277bc4a9ecf27d31.tar.gz
linux-stable-51b07e0fc822012e34653f99277bc4a9ecf27d31.tar.bz2
linux-stable-51b07e0fc822012e34653f99277bc4a9ecf27d31.zip
ALSA: ctl: fix error path at adding user-defined element set
commit 95a793c3bc75cf888e0e641d656e7d080f487d8b upstream. When processing request to add/replace user-defined element set, check of given element identifier and decision of numeric identifier is done in "__snd_ctl_add_replace()" helper function. When the result of check is wrong, the helper function returns error code. The error code shall be returned to userspace application. Current implementation includes bug to return zero to userspace application regardless of the result. This commit fixes the bug. Cc: <stable@vger.kernel.org> Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20201113092043.16148-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/control.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 2be860a446a2..43c8eac250b8 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1349,7 +1349,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
unlock:
up_write(&card->controls_rwsem);
- return 0;
+ return err;
}
static int snd_ctl_elem_add_user(struct snd_ctl_file *file,