linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
To: dan.carpenter@oracle.com, kbuild@lists.01.org
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-mm@kvack.org,
	broonie@kernel.org, Jiasheng Jiang <jiasheng@iscas.ac.cn>
Subject: Re: [linux-next:master 9388/11353] sound/soc/soc-compress.c:628 snd_soc_new_compress() error: we previously assumed 'codec_dai' could be null (see line 571)
Date: Wed,  9 Mar 2022 17:32:19 +0800	[thread overview]
Message-ID: <20220309093219.1142599-1-jiasheng@iscas.ac.cn> (raw)

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



             reply	other threads:[~2022-03-09  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  9:32 Jiasheng Jiang [this message]
2022-03-09 10:18 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2022-03-10  1:38 Jiasheng Jiang
2022-03-08 17:58 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309093219.1142599-1-jiasheng@iscas.ac.cn \
    --to=jiasheng@iscas.ac.cn \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox