Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: oder_chiou@realtek.com
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: rt5514: add rt5514 SPI driver
Date: Thu, 16 Jun 2016 13:49:25 +0300	[thread overview]
Message-ID: <20160616104925.GC24067@mwanda> (raw)

Hello Oder Chiou,

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

The patch 6eebf35b0e4a: "ASoC: rt5514: add rt5514 SPI driver" from 
Jun 6, 2016, leads to the following Smatch complaint:

sound/soc/codecs/rt5514-spi.c:87 rt5514_spi_copy_work()
	 warn: variable dereferenced before check 'rt5514_dsp->substream' (see line 83)

sound/soc/codecs/rt5514-spi.c
    82			container_of(work, struct rt5514_dsp, copy_work.work);
    83		struct snd_pcm_runtime *runtime = rt5514_dsp->substream->runtime;
                                                  ^^^^^^^^^^^^^^^^^^^^^^^
Dereference.

    84		size_t period_bytes, truncated_bytes = 0;
    85	
    86		mutex_lock(&rt5514_dsp->dma_lock);
    87		if (!rt5514_dsp->substream) {
                     ^^^^^^^^^^^^^^^^^^^^^
Checked too late.

    88			dev_err(rt5514_dsp->dev, "No pcm substream\n");
    89			goto done;

regards,
dan carpenter

                 reply	other threads:[~2016-06-16 10:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160616104925.GC24067@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=oder_chiou@realtek.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