diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-11-08 12:44:31 +0300 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-05-28 12:35:06 +0200 |
commit | 9b987c4d74ba2ac695d28a155e3cf2a8a48d426f (patch) | |
tree | 92281ac5a2a07b3211a57cdb49a94d5a6081a448 /arch/mips/lasat | |
parent | 2b436a351803f38d0c8ca9c26103472c8aaeb599 (diff) | |
download | linux-9b987c4d74ba2ac695d28a155e3cf2a8a48d426f.tar.bz2 |
MIPS: Lasat: A couple off by one bugs in picvue_proc.c
These should be ">=" instead of ">" or we go past the end of the
pvc_lines[] array.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-mips@linux-mips.org
Cc: kernel-janitors@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/6124/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/lasat')
-rw-r--r-- | arch/mips/lasat/picvue_proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c index b42095880667..27533c109f92 100644 --- a/arch/mips/lasat/picvue_proc.c +++ b/arch/mips/lasat/picvue_proc.c @@ -43,7 +43,7 @@ static int pvc_line_proc_show(struct seq_file *m, void *v) { int lineno = *(int *)m->private; - if (lineno < 0 || lineno > PVC_NLINES) { + if (lineno < 0 || lineno >= PVC_NLINES) { printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno); return 0; } @@ -67,7 +67,7 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf, char kbuf[PVC_LINELEN]; size_t len; - BUG_ON(lineno < 0 || lineno > PVC_NLINES); + BUG_ON(lineno < 0 || lineno >= PVC_NLINES); len = min(count, sizeof(kbuf) - 1); if (copy_from_user(kbuf, buf, len)) |