Skip to content

Commit

Permalink
ALSA: au88x0: Fix calculation in vortex_wtdma_bufshift()
Browse files Browse the repository at this point in the history
commit 62db715 upstream.

vortex_wtdma_bufshift() function does calculate the page index
wrongly, first masking then shift, which always results in zero.
The proper computation is to first shift, then mask.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Takashi Iwai authored and Greg Kroah-Hartman committed Jul 27, 2016
1 parent 27948f9 commit dbcbd27
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/pci/au88x0/au88x0_core.c
Original file line number Diff line number Diff line change
@@ -1442,9 +1442,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma)
int page, p, pp, delta, i;

page =
(hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) &
WT_SUBBUF_MASK)
>> WT_SUBBUF_SHIFT;
(hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2))
>> WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK;
if (dma->nr_periods >= 4)
delta = (page - dma->period_real) & 3;
else {

0 comments on commit dbcbd27

Please sign in to comment.