Commit 8562ff72 authored by Roel Kluin's avatar Roel Kluin Committed by James Toy

It reads linetable[] before checking bounds of index, and ARRAY_SIZE is

required because linetable[] are unsigned shorts.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ea84e9de
...@@ -216,7 +216,7 @@ static void newport_get_screensize(void) ...@@ -216,7 +216,7 @@ static void newport_get_screensize(void)
} }
newport_xsize = newport_ysize = 0; newport_xsize = newport_ysize = 0;
for (i = 0; linetable[i + 1] && (i < sizeof(linetable)); i += 2) { for (i = 0; i < ARRAY_SIZE(linetable) - 1 && linetable[i + 1]; i += 2) {
cols = 0; cols = 0;
newport_vc2_set(npregs, VC2_IREG_RADDR, linetable[i]); newport_vc2_set(npregs, VC2_IREG_RADDR, linetable[i]);
npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM | npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
......
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