Bug 78061

Summary: tty/vt/vt.c: 4 * leap before look problems ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.16-rc1 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-06-16 09:22:14 UTC
[linux-3.16-rc1/drivers/tty/vt/vt.c:1363]: (style) Array index 'i' is used before limits check.
[linux-3.16-rc1/drivers/tty/vt/vt.c:1368]: (style) Array index 'i' is used before limits check.
[linux-3.16-rc1/drivers/tty/vt/vt.c:1384]: (style) Array index 'i' is used before limits check.
[linux-3.16-rc1/drivers/tty/vt/vt.c:1389]: (style) Array index 'i' is used before limits check.

First one is

               if (vc->vc_par[i] == 5 &&  /* 256 colours */
                    i < vc->vc_npar) {     /* ubiquitous */

Suggest code rework.