aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-08-22 09:55:36 +0200
committerKamal Mostafa <kamal@canonical.com>2013-09-05 12:45:36 -0700
commite00946bda583513b8a1f22a8b3c635334c761960 (patch)
tree089b0a688ea279f8c446f955c41e938b8f2373c2
parent1227e621415022d884f01b3302a3d8917b94abe9 (diff)
ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
commit 2ca320e294a738c9134a71b5029de05edbfc7aad upstream. Without the dynamic minor assignment, HDMI codec may have less PCM instances than the number of pins, which eventually leads to Oops. Reported-by: Stratos Karafotis <stratosk@semaphore.gr> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
-rw-r--r--sound/pci/hda/patch_hdmi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index ad2339063efb..5c19496c702b 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1617,6 +1617,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
struct snd_pcm_chmap *chmap;
struct snd_kcontrol *kctl;
int i;
+
+ if (!codec->pcm_info[pin_idx].pcm)
+ break;
err = snd_pcm_add_chmap_ctls(codec->pcm_info[pin_idx].pcm,
SNDRV_PCM_STREAM_PLAYBACK,
NULL, 0, pin_idx, &chmap);