aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/jazz
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-07-31 08:52:51 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-08-03 12:52:47 -0400
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 f0fd636723be..0d64d0f46418 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -190,7 +190,7 @@ int vdma_free(unsigned long laddr)
190 return -1; 190 return -1;
191 } 191 }
192 192
193 while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) { 193 while (i < VDMA_PGTBL_ENTRIES && pgtbl[i].owner == laddr) {
194 pgtbl[i].owner = VDMA_PAGE_EMPTY; 194 pgtbl[i].owner = VDMA_PAGE_EMPTY;
195 i++; 195 i++;
196 } 196 }