On Wed, Mar 09, 2022 at 01:58:04AM +0800, Dan Carpenter wrote: > smatch warnings: > sound/soc/soc-compress.c:628 snd_soc_new_compress() error: we previously assumed 'codec_dai' could be null (see line 571) > de2c6f98817fa5d Jiasheng Jiang 2021-10-15 @571 if (codec_dai) { > > Can codec_dai be NULL? This new code assumes so. > aeb6fa0f15c71a1 Peng Donglin 2017-08-16 @628 rtd->dai_link->stream_name, codec_dai->name, num); > ^^^^^^^^^^^^^^^^ > Unchecked dereference Actually, if 'codec_dai' is NULL, the check in line 584 will fail and return -EINVAL. a1068045883ed4a Vinod Koul 2016-01-07 584 if (playback + capture != 1) { 141dfc9e3751f5f Charles Keepax 2018-01-26 585 dev_err(rtd->card->dev, 141dfc9e3751f5f Charles Keepax 2018-01-26 586 "Compress ASoC: Invalid direction for P %d, C %d\n", a1068045883ed4a Vinod Koul 2016-01-07 587 playback, capture); a1068045883ed4a Vinod Koul 2016-01-07 588 return -EINVAL; a1068045883ed4a Vinod Koul 2016-01-07 589 } Thanks, Jiang