[bug report] ASoC: SOF: compr: Add compress ops implementation

Dan Carpenter dan.carpenter at oracle.com
Thu Feb 10 09:34:44 CET 2022


Hello Daniel Baluta,

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

The patch 6324cf901e14: "ASoC: SOF: compr: Add compress ops 
implementation" from Jan 20, 2022, leads to the following Smatch 
complaint:

    sound/soc/sof/compress.c:54 snd_sof_compr_fragment_elapsed()
    warn: variable dereferenced before check 'cstream' (see line 48)

sound/soc/sof/compress.c
    47	{
    48		struct snd_soc_pcm_runtime *rtd = cstream->private_data;
    49		struct snd_compr_runtime *crtd = cstream->runtime;
                                                 ^^^^^^^^^^^^^^^^
The patch adds a new dereference

    50		struct snd_soc_component *component;
    51		struct snd_compr_tstamp *tstamp;
    52		struct snd_sof_pcm *spcm;
    53	
    54		if (!cstream)
                    ^^^^^^^^
The old code assumed "cstream" could be NULL

    55			return;
    56	

regards,
dan carpenter


More information about the Alsa-devel mailing list