aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 14:43:33 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 14:43:33 -0800
commiteca968305c2a5fbc3445c22b8e8e809196d28893 (patch)
treee52541142a59d00789731f0b50d8dca1f9fcb557 /sound/pci/hda/hda_codec.c
parentd381f45c890a3fb136afb0dc1cbe025e066cb981 (diff)
parent69a4cfdd444d1fe5c24d29b3a063964ac165d2cd (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All are boring small fixes in various parts: - A few possible NULL-dereference or zero-division Oops fixes - Fix vmaster slave volume notification - Add codec ID for ALC233 - Various fixes in several ASoC WM codecs - ASoC tegra i2c fix Sorry if you wanted a thrilling adventure with huge sharks :)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: ice1712: Initialize card->private_data properly ALSA: hda - Add support of new codec ALC233 ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg() ALSA: hda - check NULL pointer when creating SPDIF PCM switch ALSA: hda - check NULL pointer when creating SPDIF controls ASoC: wm5102: Apply a SYSCLK patch for later revs ALSA: vmaster: Fix slave change notification ASoC: tegra: fix I2S bit count mask ALSA: seq: seq_oss_event: missing range checks ASoC: wm8350: Use jiffies rather than msecs in schedule_delayed_work() ASoC: wm5110: Correct OUT2/3 volume and switch names ASoC: wm5102: Correct OUT2 volume and switch names ASoC: wm8960: Fix ADC power bits ASoC: wm8960: Correct register 0 and 1 defaults
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 04b57383e8cb..97c68dd24ef5 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);