summaryrefslogtreecommitdiffstats
path: root/drivers/char/applicom.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-03-01 23:31:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 12:23:48 -0700
commit2154e0a4f43e0c811737e391e7981d331e450d42 (patch)
tree3c373d1aca03f7c20129d10433a69691721d0d8c /drivers/char/applicom.c
parente926301b39a07f587ff8c66354a2e2ee4c29162c (diff)
downloadlinux-stable-2154e0a4f43e0c811737e391e7981d331e450d42.tar.gz
linux-stable-2154e0a4f43e0c811737e391e7981d331e450d42.tar.bz2
linux-stable-2154e0a4f43e0c811737e391e7981d331e450d42.zip
applicom: use correct array offset
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>
Diffstat (limited to 'drivers/char/applicom.c')
-rw-r--r--drivers/char/applicom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 25373df1dcf8..974321a2508d 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -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);