[alsa-devel] ASoC: Intel: Add Skylake HDA platform driver

Dan Carpenter dan.carpenter at oracle.com
Wed Oct 21 22:53:14 CEST 2015


Hello Jeeja KP,

This is a semi-automatic email about new static checker warnings.

The patch a40e693c7f5e: "ASoC: Intel: Add Skylake HDA platform 
driver" from Jul 9, 2015, leads to the following Smatch complaint:

sound/soc/intel/skylake/skl-pcm.c:802 skl_get_position()
	 warn: variable dereferenced before check 'substream->runtime' (see line 792)

sound/soc/intel/skylake/skl-pcm.c
   791		struct snd_pcm_substream *substream = hstr->substream;
   792		struct hdac_ext_bus *ebus = get_bus_ctx(substream);
                                            ^^^^^^^^^^^^^^^^^^^^^^
Dereference inside function.

   793		unsigned int pos;
   794		int delay;
   795	
   796		/* use the position buffer as default */
   797		pos = snd_hdac_stream_get_pos_posbuf(hdac_stream(hstream));
   798	
   799		if (pos >= hdac_stream(hstream)->bufsize)
   800			pos = 0;
   801	
   802		if (substream->runtime) {
                    ^^^^^^^^^^^^^^^^^^
Checked too late.

   803			delay = skl_get_delay_from_lpib(ebus, hstream, pos)
   804							 + codec_delay;

regards,
dan carpenter


More information about the Alsa-devel mailing list