summaryrefslogtreecommitdiff
path: root/drivers/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-10-14 16:26:08 +0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-15 15:47:59 +0400
commit9784bd4f1a6ea736ad9bf241f5a965e0a2913a5e (patch)
tree8e738103f83aa9a6b40baf1ddfc66cbf43098a45 /drivers/s390
parent0ebfd313fd4baf3fa1bd02d5f106e377595d4987 (diff)
downloadlinux-9784bd4f1a6ea736ad9bf241f5a965e0a2913a5e.tar.xz
s390/vmlogrdr: fix array access in vmlogrdr_open()
Fix check within vmlogrdr_open() if the minor address is not larger than the number of array elements. Found with "smatch": drivers/s390/char/vmlogrdr.c:318 vmlogrdr_open() warn: buffer overflow 'sys_ser' 3 <= 3 Acked-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/vmlogrdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 9b3a24e8d3a0..cf31d3321dab 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp)
int ret;
dev_num = iminor(inode);
- if (dev_num > MAXMINOR)
+ if (dev_num >= MAXMINOR)
return -ENODEV;
logptr = &sys_ser[dev_num];