diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-08-22 09:55:36 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-07 22:09:57 -0700 |
commit | da958137df4bcd9b2b5ea83db75f66a46c3ef46f (patch) | |
tree | ddb6962a50348fbca323abd394a21804f7ce6303 /sound | |
parent | 192caed2bfb7072b7f364dc909b43fd7604b991d (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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 496d7f21d3e5..5bc419452198 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1715,6 +1715,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); |