On Wed, Mar 09, 2022 at 18:18:23PM +0800, Dan Carpenter wrote: > Yeah. That's true. Smatch tries to look at conditions and figure out > the implications but this one is too complicated. > > But if codec_dai can really be NULL then it would be easier to > understand if we reversed the check on codec_dai and returned early. > > if (!codec_dai) { > dev_err(rtd->card->dev, "Missing codec\n"); > return -EINVAL; > } > > /* check client and interface hw capabilities */ > if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && > snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK)) > playback = 1; Thanks, it looks good to me. I will submit a patch with "Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>" to make the code more clear. Jiang