Commit 08ede038 authored by Lu Guanqun's avatar Lu Guanqun Committed by Takashi Iwai

ALSA: core: release the constraint check for replace ops

Suppose the ALSA card already has a number of MAX_USER_CONTROLS controls, and
the user wants to replace one, it should not fail at this condition check.
Signed-off-by: default avatarLu Guanqun <guanqun.lu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 983929ca
...@@ -1073,7 +1073,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, ...@@ -1073,7 +1073,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
struct user_element *ue; struct user_element *ue;
int idx, err; int idx, err;
if (card->user_ctl_count >= MAX_USER_CONTROLS) if (!replace && card->user_ctl_count >= MAX_USER_CONTROLS)
return -ENOMEM; return -ENOMEM;
if (info->count < 1) if (info->count < 1)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment