24 Aug
2011
24 Aug
'11
5:12 a.m.
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 --- sound/core/control.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/core/control.c b/sound/core/control.c index 7f2b3a7..98b7fc7 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 (card->user_ctl_count >= MAX_USER_CONTROLS + !!replace) return -ENOMEM; if (info->count < 1) return -EINVAL;