aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2009-08-17 06:25:52 -0400
committerTakashi Iwai <tiwai@suse.de>2009-08-17 06:48:00 -0400
commit2a031aedf7f574a01eb725507cb303d4d7b8b23a (patch)
treebcf05d5a7f586f0428de847214cfa21db49b8189 /sound/core
parent64f1607ffbbc772685733ea63e6f7f4183df1b16 (diff)
sound: snd_ctl_elem_add: fix value count check
Make sure that no user element that has no values can be added. The check for count>1024 is not needed because the count is checked later for the individual control types. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/control.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 17b8d47a5cd0..66d6aaf9314c 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -951,7 +951,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
951 951
952 if (card->user_ctl_count >= MAX_USER_CONTROLS) 952 if (card->user_ctl_count >= MAX_USER_CONTROLS)
953 return -ENOMEM; 953 return -ENOMEM;
954 if (info->count > 1024) 954 if (info->count < 1)
955 return -EINVAL; 955 return -EINVAL;
956 access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : 956 access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
957 (info->access & (SNDRV_CTL_ELEM_ACCESS_READWRITE| 957 (info->access & (SNDRV_CTL_ELEM_ACCESS_READWRITE|