diff options
Diffstat (limited to 'sound/core/control.c')
-rw-r--r-- | sound/core/control.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 03ae9bb7d38..f8f98cc5241 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -195,8 +195,10 @@ struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, unsigned int acce snd_assert(control != NULL, return NULL); snd_assert(control->count > 0, return NULL); kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); - if (kctl == NULL) + if (kctl == NULL) { + snd_printk(KERN_ERR "Cannot allocate control instance\n"); return NULL; + } *kctl = *control; for (idx = 0; idx < kctl->count; idx++) kctl->vd[idx].access = access; @@ -309,7 +311,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) struct snd_ctl_elem_id id; unsigned int idx; - snd_assert(card != NULL && kcontrol != NULL, return -EINVAL); + snd_assert(card != NULL, return -EINVAL); + if (! kcontrol) + return -EINVAL; snd_assert(kcontrol->info != NULL, return -EINVAL); id = kcontrol->id; down_write(&card->controls_rwsem); |