]> Pileus Git - ~andy/linux/commitdiff
applicom: use correct array offset
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Mar 2013 20:31:46 +0000 (23:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 19:23:48 +0000 (12:23 -0700)
We're iterating through abps[] printing information, but here we
use the wrong array index.  IndexCard comes from the user and in
this case it was specifically not range checked because we didn't
expect to use it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/applicom.c

index 25373df1dcf8c256404626dc4376c56253039089..974321a2508d861655d1883480a902476ccc7a58 100644 (file)
@@ -804,8 +804,8 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                        printk(KERN_INFO "Prom version board %d ....... V%d.%d %s",
                               i+1,
-                              (int)(readb(apbs[IndexCard].RamIO + VERS) >> 4),
-                              (int)(readb(apbs[IndexCard].RamIO + VERS) & 0xF),
+                              (int)(readb(apbs[i].RamIO + VERS) >> 4),
+                              (int)(readb(apbs[i].RamIO + VERS) & 0xF),
                               boardname);