Commit ce85c9ac authored by Raymond Yau's avatar Raymond Yau Committed by Takashi Iwai

ALSA: hda - fix NULL-dereference in patch_realtek

Fix NULL-dereference when try to use alt_playback since those codecs
which support multistreaming playback usually have more than 1 adc but
the driver should create alt_capture when spec->stream_analog_alt_capture
is also defined.
Signed-off-by: default avatarRaymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 20ec8b24
...@@ -4424,7 +4424,7 @@ static int alc_build_pcms(struct hda_codec *codec) ...@@ -4424,7 +4424,7 @@ static int alc_build_pcms(struct hda_codec *codec)
alc_pcm_null_stream; alc_pcm_null_stream;
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0; info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0;
} }
if (spec->num_adc_nids > 1) { if (spec->num_adc_nids > 1 && spec->stream_analog_alt_capture) {
info->stream[SNDRV_PCM_STREAM_CAPTURE] = info->stream[SNDRV_PCM_STREAM_CAPTURE] =
*spec->stream_analog_alt_capture; *spec->stream_analog_alt_capture;
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = info->stream[SNDRV_PCM_STREAM_CAPTURE].nid =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment