Commit b753d79c authored by Takashi Iwai's avatar Takashi Iwai Committed by Willy Tarreau

ALSA: au88x0: Fix calculation in vortex_wtdma_bufshift()

commit 62db7152 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent c3fdd7d3
...@@ -1442,9 +1442,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma) ...@@ -1442,9 +1442,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma)
int page, p, pp, delta, i; int page, p, pp, delta, i;
page = page =
(hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) & (hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2))
WT_SUBBUF_MASK) >> WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK;
>> WT_SUBBUF_SHIFT;
if (dma->nr_periods >= 4) if (dma->nr_periods >= 4)
delta = (page - dma->period_real) & 3; delta = (page - dma->period_real) & 3;
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment