summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-08-22 11:55:36 +0400
committerTakashi Iwai <tiwai@suse.de>2013-08-23 01:22:39 +0400
commit2ca320e294a738c9134a71b5029de05edbfc7aad (patch)
tree69e69bfbef1b83b2381c944e6721415927684d73 /sound/pci/hda/patch_hdmi.c
parentd3d3835ce919438c00c5d1270d6f9d6ffea59d03 (diff)
downloadlinux-2ca320e294a738c9134a71b5029de05edbfc7aad.tar.xz
ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
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> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-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 030ca8652a1c..9f3586276871 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1781,6 +1781,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);