Skip to content

Commit

Permalink
MIPS: Jazz: Fix read buffer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Ralf Baechle committed Aug 3, 2009
1 parent 64f1815 commit 3d4656d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/jazz/jazzdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 3d4656d

Please sign in to comment.