[alsa-devel] ALSA: hda - Don't check capture source mixer if no ADC is available

Dan Carpenter error27 at gmail.com
Mon Jun 28 12:09:58 CEST 2010


Commit fbe618f2168 "ALSA: hda - Don't check capture source mixer if no
ADC is available" added support for when there is no ADC available and
spec->adc_nids is NULL.  If spec->adc_nids is NULL, can it cause a
problem later when we call snd_hda_add_nid()?

sound/pci/hda/patch_realtek.c +2643 alc_build_controls(96)
	error: we previously assumed 'spec->adc_nids' could be null.
  2635          if (spec->cap_mixer) {
  2636                  const char *kname = kctl ? kctl->id.name : NULL;
  2637                  for (knew = spec->cap_mixer; knew->name; knew++) {
  2638                          if (kname && strcmp(knew->name, kname) == 0)
  2639                                  continue;
  2640                          kctl = snd_hda_find_mixer_ctl(codec, knew->name);
  2641                          for (i = 0; kctl && i < kctl->count; i++) {
  2642                                  err = snd_hda_add_nid(codec, kctl, i,
  2643							      spec->adc_nids[i]);
                                                              ^^^^^^^^^^^^^^^^^
  2644                                  if (err < 0)
  2645                                          return err;
  2646                          }
  2647                  }
  2648          }

regards,
dan carpenter


More information about the Alsa-devel mailing list