dbri: move dereference after check for NULL
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
Goes into the sparc tree.
sound/sparc/dbri.c +2 -1
@@ -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);
Quoted 22 lines · Dan Carpenter
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 <[email protected]>---
Goes into the sparc tree.sound/sparc/dbri.c +1
-1@@ -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;
sound/sparc/dbri.c static void xmit_descs(struct snd_dbri *dbri) · line 1715
Quoted 6 lines
sound/sparc/dbri.c +1
-0@@ -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
Quoted 1 line
David Miller
AppliedFrom: Dan Carpenter <[email protected]>
Date: Thu, 1 Dec 2016 08:48:30 +0300
Quoted 5 lines
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 <[email protected]>
Applied, thanks Dan.