From 73e77ba0235532bd7523ba90883d325f6e095acf Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:44:01 +0100 Subject: [ALSA] Add error messages Add error messages in the critial error path to be more verbose. Signed-off-by: Takashi Iwai --- sound/core/control.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sound/core/control.c') 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); -- cgit v1.2.3