diff options
| author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2013-04-08 21:36:54 +0200 |
|---|---|---|
| committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2013-04-08 21:36:54 +0200 |
| commit | 0b824f8dad9fdfc7c1bf9c1d3ac744075eb73ec6 (patch) | |
| tree | 7559859702f2fa02f6a4db64cf10f6c2e3f80c21 /sound/pci/hda/hda_codec.c | |
| parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) | |
| parent | 3d5a96582303e28c48699f3faaf920ef7d43e6f2 (diff) | |
| download | olio-linux-3.10-0b824f8dad9fdfc7c1bf9c1d3ac744075eb73ec6.tar.xz olio-linux-3.10-0b824f8dad9fdfc7c1bf9c1d3ac744075eb73ec6.zip | |
Merge remote-tracking branch 'arm-soc/clksrc/cleanup' into sunxi/core-for-3.10
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
| -rw-r--r-- | sound/pci/hda/hda_codec.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 04b57383e8c..97c68dd24ef 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, return -EBUSY; } spdif = snd_array_new(&codec->spdif_out); + if (!spdif) + return -ENOMEM; for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { kctl = snd_ctl_new1(dig_mix, codec); if (!kctl) @@ -3431,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = { int snd_hda_create_spdif_share_sw(struct hda_codec *codec, struct hda_multi_out *mout) { + struct snd_kcontrol *kctl; + if (!mout->dig_out_nid) return 0; + + kctl = snd_ctl_new1(&spdif_share_sw, mout); + if (!kctl) + return -ENOMEM; /* ATTENTION: here mout is passed as private_data, instead of codec */ - return snd_hda_ctl_add(codec, mout->dig_out_nid, - snd_ctl_new1(&spdif_share_sw, mout)); + return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl); } EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); |