]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/pci/hda/patch_hdmi.c
ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
[karo-tx-linux.git] / sound / pci / hda / patch_hdmi.c
index 030ca8652a1cb3b5b8f825d684b69ec1bb2daacc..9f35862768713899cad3ba865bb9d13b3cee796a 100644 (file)
@@ -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);