ASoC: Intel: Add Skylake HDA platform driver
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
Quoted 17 lines
Quoted 17 lines
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:802skl_get_position()warn: variable dereferenced before check 'substream->runtime' (seeline 792)
sound/soc/intel/skylake/skl-pcm.c791 struct snd_pcm_substream *substream = hstr->substream; 792 struct hdac_ext_bus *ebus = get_bus_ctx(substream); ^^^^^^^^^^^^^^^^^^^^^^ Dereference insidefunction.
Quoted 13 lines
Quoted 12 lines
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) { ^^^^^^^^^^^^^^^^^^Quoted 1 line
Checked too late.
Right, will move ebus init here.
Thanks for reporting this
Quoted 6 lines
Quoted 6 lines
803 delay = skl_get_delay_from_lpib(ebus, hstream, pos) 804 + codec_delay;regards,
dan carpenter
Signature · 1 line
~Vinod