diff options
| author | David S. Miller <davem@davemloft.net> | 2010-10-06 19:11:17 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-10-06 19:11:17 -0700 |
| commit | 12e94471b2be5ef9b55b10004a3a2cd819490036 (patch) | |
| tree | f84ae818687dc7c35bd54f11bfb9717278d28a4e /sound/core/control.c | |
| parent | 79315068f4560f3f7bd6e9790190dcb43059770c (diff) | |
| parent | cb655d0f3d57c23db51b981648e452988c0223f9 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'sound/core/control.c')
| -rw-r--r-- | sound/core/control.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 070aab49019..45a818002d9 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -31,6 +31,7 @@ /* max number of user-defined controls */ #define MAX_USER_CONTROLS 32 +#define MAX_CONTROL_COUNT 1028 struct snd_kctl_ioctl { struct list_head list; /* list of all ioctls */ @@ -195,6 +196,10 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, if (snd_BUG_ON(!control || !control->count)) return NULL; + + if (control->count > MAX_CONTROL_COUNT) + return NULL; + kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); if (kctl == NULL) { snd_printk(KERN_ERR "Cannot allocate control instance\n"); |
