alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: tndave <tushar.n.dave@oracle.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>,
	thomas tai <thomas.tai@oracle.com>,
	alsa-devel@alsa-project.org, sparclinux@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] dbri: move dereference after check for NULL
Date: Wed, 30 Nov 2016 22:14:26 -0800	[thread overview]
Message-ID: <7cd722db-08d4-4c96-9e31-a8d98365e6f3@oracle.com> (raw)
In-Reply-To: <20161201054830.GA20077@mwanda>



On 11/30/2016 09:48 PM, Dan Carpenter wrote:
> We accidentally introduced a dereference before the NULL check in
> xmit_descs() as part of silencing a GCC warning.
>
> Fixes: 16f46050e709 ("dbri: Fix compiler warning")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Goes into the sparc tree.
>
> diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
> index 3fe4468..52063b2 100644
> --- a/sound/sparc/dbri.c
> +++ b/sound/sparc/dbri.c
> @@ -1702,7 +1702,7 @@ interrupts are disabled.
>  static void xmit_descs(struct snd_dbri *dbri)
>  {
>  	struct dbri_streaminfo *info;
> -	u32 dvma_addr = (u32)dbri->dma_dvma;
> +	u32 dvma_addr;
>  	s32 *cmd;
>  	unsigned long flags;
>  	int first_td;
> @@ -1710,6 +1710,7 @@ static void xmit_descs(struct snd_dbri *dbri)
>  	if (dbri == NULL)
>  		return;		/* Disabled */
>
> +	dvma_addr = (u32)dbri->dma_dvma;
>  	info = &dbri->stream_info[DBRI_REC];
>  	spin_lock_irqsave(&dbri->lock, flags);
Thanks for catching this.

-Tushar

>

  reply	other threads:[~2016-12-01  6:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01  5:48 [patch] dbri: move dereference after check for NULL Dan Carpenter
2016-12-01  6:14 ` tndave [this message]
2016-12-06 17:19 ` David Miller

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=7cd722db-08d4-4c96-9e31-a8d98365e6f3@oracle.com \
    --to=tushar.n.dave@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sparclinux@vger.kernel.org \
    --cc=thomas.tai@oracle.com \
    --cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).