ALSA: core: release the constraint check for replace ops
authorLu Guanqun <guanqun.lu@intel.com>
Wed, 24 Aug 2011 06:45:10 +0000 (14:45 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 24 Aug 2011 08:22:43 +0000 (10:22 +0200)
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 <guanqun.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c

index 7f2b3a7eabb2bbaadb2b2b93d697d6c6d9c810fc..dc2a44048c850e988126cf384ce0c26d6d10e7d0 100644 (file)
@@ -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;