From: Takashi Iwai Date: Fri, 6 Feb 2009 15:21:20 +0000 (+0100) Subject: ALSA: hda - Add missing NULL check in snd_hda_create_spdif_in_ctls() X-Git-Tag: v2.6.30-rc1~676^2~12^2~102 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c8dcdf829ca1827a802eae841dd04de8c9d6653f;p=~emulex%2Finfiniband.git ALSA: hda - Add missing NULL check in snd_hda_create_spdif_in_ctls() Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index c9158799ccb..93412f335dc 100644 --- a/sound/pci/hda/hda_codec.c +++ b/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)