Skip to contentSkip to conversation

ASoC: SOF: compr: Add compress ops implementation

bug report Dan Carpenter 1 participant 1 message Feb 10, 2022

lore
Share & tools
lore
#0 lore raw

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