Source
602
602
*ppos = p;
603
603
return virtr + wrote ? : err;
604
604
}
605
605
606
606
static ssize_t read_port(struct file *file, char __user *buf,
607
607
size_t count, loff_t *ppos)
608
608
{
609
609
unsigned long i = *ppos;
610
610
char __user *tmp = buf;
611
611
612
-
if (!access_ok(VERIFY_WRITE, buf, count))
612
+
if (!access_ok(buf, count))
613
613
return -EFAULT;
614
614
while (count-- > 0 && i < 65536) {
615
615
if (__put_user(inb(i), tmp) < 0)
616
616
return -EFAULT;
617
617
i++;
618
618
tmp++;
619
619
}
620
620
*ppos = i;
621
621
return tmp-buf;
622
622
}
623
623
624
624
static ssize_t write_port(struct file *file, const char __user *buf,
625
625
size_t count, loff_t *ppos)
626
626
{
627
627
unsigned long i = *ppos;
628
628
const char __user *tmp = buf;
629
629
630
-
if (!access_ok(VERIFY_READ, buf, count))
630
+
if (!access_ok(buf, count))
631
631
return -EFAULT;
632
632
while (count-- > 0 && i < 65536) {
633
633
char c;
634
634
635
635
if (__get_user(c, tmp)) {
636
636
if (tmp > buf)
637
637
break;
638
638
return -EFAULT;
639
639
}
640
640
outb(c, i);