From: Dan Carpenter <dan.carpenter@oracle.com>
To: "David S. Miller" <davem@davemloft.net>,
Tushar Dave <tushar.n.dave@oracle.com>
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: [patch] dbri: move dereference after check for NULL
Date: Thu, 1 Dec 2016 08:48:30 +0300 [thread overview]
Message-ID: <20161201054830.GA20077@mwanda> (raw)
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);
next reply other threads:[~2016-12-01 5:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 5:48 Dan Carpenter [this message]
2016-12-01 6:14 ` [patch] dbri: move dereference after check for NULL tndave
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=20161201054830.GA20077@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--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 \
--cc=tushar.n.dave@oracle.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).