Skip to content

Commit 95a793c

Browse files
takaswietiwai
authored andcommitted
ALSA: ctl: fix error path at adding user-defined element set
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: e1a7bfe ("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>
1 parent 9e88577 commit 95a793c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/core/control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
15391539

15401540
unlock:
15411541
up_write(&card->controls_rwsem);
1542-
return 0;
1542+
return err;
15431543
}
15441544

15451545
static int snd_ctl_elem_add_user(struct snd_ctl_file *file,

0 commit comments

Comments
 (0)