Message ID | 1404379241-8590-184-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/sound/core/control.c b/sound/core/control.c index 93215b4bec6b..98a29b26c5f4 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -343,6 +343,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) if (snd_BUG_ON(!card || !kcontrol->info)) goto error; id = kcontrol->id; + if (id.index > UINT_MAX - kcontrol->count) + goto error; + down_write(&card->controls_rwsem); if (snd_ctl_find_id(card, &id)) { up_write(&card->controls_rwsem);