Skip to content

Commit

Permalink
ALSA: ctl: fix error path at adding user-defined element set
Browse files Browse the repository at this point in the history
commit 95a793c 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
takaswie authored and gregkh committed Nov 24, 2020
1 parent dead6fe commit 0976f5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,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,
Expand Down

0 comments on commit 0976f5c

Please sign in to comment.