aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/lasat/picvue_proc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-11-08 04:44:31 -0500
committerRalf Baechle <ralf@linux-mips.org>2016-05-28 06:35:06 -0400
commit9b987c4d74ba2ac695d28a155e3cf2a8a48d426f (patch)
tree92281ac5a2a07b3211a57cdb49a94d5a6081a448 /arch/mips/lasat/picvue_proc.c
parent2b436a351803f38d0c8ca9c26103472c8aaeb599 (diff)
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/picvue_proc.c')
-rw-r--r--arch/mips/lasat/picvue_proc.c4
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)
43{ 43{
44 int lineno = *(int *)m->private; 44 int lineno = *(int *)m->private;
45 45
46 if (lineno < 0 || lineno > PVC_NLINES) { 46 if (lineno < 0 || lineno >= PVC_NLINES) {
47 printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno); 47 printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno);
48 return 0; 48 return 0;
49 } 49 }
@@ -67,7 +67,7 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
67 char kbuf[PVC_LINELEN]; 67 char kbuf[PVC_LINELEN];
68 size_t len; 68 size_t len;
69 69
70 BUG_ON(lineno < 0 || lineno > PVC_NLINES); 70 BUG_ON(lineno < 0 || lineno >= PVC_NLINES);
71 71
72 len = min(count, sizeof(kbuf) - 1); 72 len = min(count, sizeof(kbuf) - 1);
73 if (copy_from_user(kbuf, buf, len)) 73 if (copy_from_user(kbuf, buf, len))