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>
This commit is contained in:
Roel Kluin 2009-07-31 14:52:51 +02:00 committed by Ralf Baechle
parent 64f1815507
commit 3d4656d68b

View file

@ -190,7 +190,7 @@ int vdma_free(unsigned long laddr)
return -1;
}
while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) {
while (i < VDMA_PGTBL_ENTRIES && pgtbl[i].owner == laddr) {
pgtbl[i].owner = VDMA_PAGE_EMPTY;
i++;
}