Add NULL-check of the return value of snd_kctl_new1() before
accessing it.  Also, make a sanity NULL check to snd_BUG_ON()
for debugging only.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
        }
        for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
                kctl = snd_ctl_new1(dig_mix, codec);
+               if (!kctl)
+                       return -ENOMEM;
                kctl->id.index = idx;
                kctl->private_value = nid;
                err = snd_hda_ctl_add(codec, kctl);
        struct hda_pcm_stream *info;
        int stream, err;
 
-       if (!pcm->name)
+       if (snd_BUG_ON(!pcm->name))
                return -EINVAL;
        for (stream = 0; stream < 2; stream++) {
                info = &pcm->stream[stream];