summaryrefslogtreecommitdiffstats
path: root/sound/sparc/dbri.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-01 06:48:30 +0100
committerDavid S. Miller <davem@davemloft.net>2016-12-06 18:18:22 +0100
commit163117e8d4fd7a235ec48479e31bbda0c74eff56 (patch)
tree3f5aa5e729a87e0b1fa9f78155442bbe675a75f9 /sound/sparc/dbri.c
parentMerge branch 'for-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-163117e8d4fd7a235ec48479e31bbda0c74eff56.tar.xz
linux-163117e8d4fd7a235ec48479e31bbda0c74eff56.zip
dbri: move dereference after check for NULL
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/sparc/dbri.c')
-rw-r--r--sound/sparc/dbri.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 3fe4468ea2c5..52063b262667 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);