Browse Source

ALSA: hda - Add missing NULL check in snd_hda_create_spdif_in_ctls()

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 16 years ago
parent
commit
c8dcdf829c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      sound/pci/hda/hda_codec.c

+ 2 - 0
sound/pci/hda/hda_codec.c

@@ -1984,6 +1984,8 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
 	}
 	for (dig_mix = dig_in_ctls; dig_mix->name; dig_mix++) {
 		kctl = snd_ctl_new1(dig_mix, codec);
+		if (!kctl)
+			return -ENOMEM;
 		kctl->private_value = nid;
 		err = snd_hda_ctl_add(codec, kctl);
 		if (err < 0)