Skip to content

Commit

Permalink
ALSA: core: release the constraint check for replace ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lu Guanqun authored and Takashi Iwai committed Aug 24, 2011
1 parent 983929c commit 08ede03
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 @@ -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;
Expand Down

0 comments on commit 08ede03

Please sign in to comment.