diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-06-29 15:23:08 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-06-29 15:26:12 +0200 |
commit | 62db7152c924e4c060e42b34a69cd39658e8a0dc (patch) | |
tree | a6c344f3ae277352df3f06b24a8b6eb6c9f30663 | |
parent | 6858107e78b4ecb9f244db814ffbdba1b5ce759b (diff) |
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: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/au88x0/au88x0_core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 4a054d720112..d3125c169684 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -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 { |