MIPS: Jazz: Fix read buffer overflow

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by Roel Kluin and committed by Ralf Baechle 3d4656d6 64f18155

+1 -1
+1 -1
arch/mips/jazz/jazzdma.c
··· 190 return -1; 191 } 192 193 - while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) { 194 pgtbl[i].owner = VDMA_PAGE_EMPTY; 195 i++; 196 }
··· 190 return -1; 191 } 192 193 + while (i < VDMA_PGTBL_ENTRIES && pgtbl[i].owner == laddr) { 194 pgtbl[i].owner = VDMA_PAGE_EMPTY; 195 i++; 196 }