mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
commit 2ca320e294 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
192caed2bf
commit
da958137df
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user