All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec'.
@ 2013-01-22 19:10 Dan Carpenter
  2013-01-22 20:25 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-01-22 19:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, kbuild

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec'.
  2013-01-22 19:10 sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec' Dan Carpenter
@ 2013-01-22 20:25 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2013-01-22 20:25 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: alsa-devel, kbuild

At Tue, 22 Jan 2013 22:10:10 +0300,
Dan Carpenter wrote:
> 
> 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'.

Thanks!  Fixed the branch now.


Takashi

> 
> 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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-22 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 19:10 sound/pci/hda/patch_analog.c:4987 patch_ad1882() error: potentially derefencing uninitialized 'spec' Dan Carpenter
2013-01-22 20:25 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.