Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62db7152 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: au88x0: Fix calculation in vortex_wtdma_bufshift()



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>
parent 6858107e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1444,9 +1444,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 {