From: Lu Guanqun Date: Wed, 24 Aug 2011 06:45:10 +0000 (+0800) Subject: ALSA: core: release the constraint check for replace ops X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=08ede038a738f22c1b3425051175e1d627d8dd43;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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: Lu Guanqun Signed-off-by: Takashi Iwai --- diff --git a/sound/core/control.c b/sound/core/control.c index 7f2b3a7eabb2..dc2a44048c85 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1073,7 +1073,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, struct user_element *ue; int idx, err; - if (card->user_ctl_count >= MAX_USER_CONTROLS) + if (!replace && card->user_ctl_count >= MAX_USER_CONTROLS) return -ENOMEM; if (info->count < 1) return -EINVAL;