Commit 3d4656d6 authored by Roel Kluin's avatar Roel Kluin Committed by Ralf Baechle

MIPS: Jazz: Fix read buffer overflow

Check whether index is within bounds before testing the element.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 64f18155
......@@ -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++;
}
......
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