[alsa-devel] sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec'.

Dan Carpenter dan.carpenter at oracle.com
Tue Jan 22 20:10:10 CET 2013


Hi Takashi,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git master
head:   96349b211586f3a6f2750bc4ea195bd9739465b6
commit: e87b24f711c797f1277188dc85b866bec17704a0 ALSA: hda - Rearrange for dropping static quirk codes in AD codec driver

New smatch warnings:
sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec'.

git remote add sound-unstable git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git
git remote update sound-unstable
git checkout e87b24f711c797f1277188dc85b866bec17704a0
vim +/spec +4987 sound/pci/hda/patch_analog.c

e87b24f7 Takashi Iwai 2013-01-22  4971  #ifdef ENABLE_AD_STATIC_QUIRKS
0ac8551e Takashi Iwai 2007-06-20  4972  static int patch_ad1882(struct hda_codec *codec)
0ac8551e Takashi Iwai 2007-06-20  4973  {
0ac8551e Takashi Iwai 2007-06-20  4974  	struct ad198x_spec *spec;
c5a4bcd0 Takashi Iwai 2009-02-06  4975  	int err, board_config;
0ac8551e Takashi Iwai 2007-06-20  4976  
78bb3cb0 Takashi Iwai 2012-12-21  4977  	board_config = snd_hda_check_board_config(codec, AD1882_MODELS,
78bb3cb0 Takashi Iwai 2012-12-21  4978  						  ad1882_models, NULL);
e87b24f7 Takashi Iwai 2013-01-22  4979  	if (board_config == AD1882_AUTO)
e87b24f7 Takashi Iwai 2013-01-22  4980  		return ad1882_parse_auto_config(codec);
78bb3cb0 Takashi Iwai 2012-12-21  4981  
c5a4bcd0 Takashi Iwai 2009-02-06  4982  	err = snd_hda_attach_beep_device(codec, 0x10);
c5a4bcd0 Takashi Iwai 2009-02-06  4983  	if (err < 0) {
c5a4bcd0 Takashi Iwai 2009-02-06  4984  		ad198x_free(codec);
c5a4bcd0 Takashi Iwai 2009-02-06  4985  		return err;
c5a4bcd0 Takashi Iwai 2009-02-06  4986  	}
c5a4bcd0 Takashi Iwai 2009-02-06 @4987  	set_beep_amp(spec, 0x10, 0, HDA_OUTPUT);
c5a4bcd0 Takashi Iwai 2009-02-06  4988  
0ac8551e Takashi Iwai 2007-06-20  4989  	spec->multiout.max_channels = 6;
0ac8551e Takashi Iwai 2007-06-20  4990  	spec->multiout.num_dacs = 3;
0ac8551e Takashi Iwai 2007-06-20  4991  	spec->multiout.dac_nids = ad1882_dac_nids;
0ac8551e Takashi Iwai 2007-06-20  4992  	spec->multiout.dig_out_nid = AD1882_SPDIF_OUT;
0ac8551e Takashi Iwai 2007-06-20  4993  	spec->num_adc_nids = ARRAY_SIZE(ad1882_adc_nids);
0ac8551e Takashi Iwai 2007-06-20  4994  	spec->adc_nids = ad1882_adc_nids;
0ac8551e Takashi Iwai 2007-06-20  4995  	spec->capsrc_nids = ad1882_capsrc_nids;

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation


More information about the Alsa-devel mailing list