aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Yau <superquad.vortex2@gmail.com>2011-05-03 01:33:53 -0400
committerTakashi Iwai <tiwai@suse.de>2011-05-03 04:32:04 -0400
commitce85c9ac8dd53a658d85b4f39f612c23aa704e49 (patch)
treebc7fe813443b063248cdbb0dc862df6b36a8c942
parent20ec8b24636e2d43435a27a55dbb7e8331c563ca (diff)
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: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c9f77152e079..4dd0cccc5a9e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4424,7 +4424,7 @@ static int alc_build_pcms(struct hda_codec *codec)
4424 alc_pcm_null_stream; 4424 alc_pcm_null_stream;
4425 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0; 4425 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0;
4426 } 4426 }
4427 if (spec->num_adc_nids > 1) { 4427 if (spec->num_adc_nids > 1 && spec->stream_analog_alt_capture) {
4428 info->stream[SNDRV_PCM_STREAM_CAPTURE] = 4428 info->stream[SNDRV_PCM_STREAM_CAPTURE] =
4429 *spec->stream_analog_alt_capture; 4429 *spec->stream_analog_alt_capture;
4430 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = 4430 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid =