summaryrefslogtreecommitdiffstats
path: root/arch/mips/jazz
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-07-31 14:52:51 +0200
committerRalf Baechle <ralf@linux-mips.org>2009-08-03 17:52:47 +0100
commit3d4656d68bad84604f5b01f93e066cd02f77154b (patch)
treecf1d8a171d7e9b39d20b671cf3079660e9501a1a /arch/mips/jazz
parent64f1815507f207ec54ee6b9ae69c48bd153e83b4 (diff)
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>
Diffstat (limited to 'arch/mips/jazz')
-rw-r--r--arch/mips/jazz/jazzdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index f0fd636723b..0d64d0f4641 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -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++;
}