git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag
[linux-2.6.git]
/
drivers
/
usb
/
host
/
uhci-debug.c
diff --git
a/drivers/usb/host/uhci-debug.c
b/drivers/usb/host/uhci-debug.c
index
c2e63e2
..
86e4c3a
100644
(file)
--- a/
drivers/usb/host/uhci-debug.c
+++ b/
drivers/usb/host/uhci-debug.c
@@
-567,8
+567,8
@@
static loff_t uhci_proc_lseek(struct file *file, loff_t off, int whence)
return (file->f_pos = new);
}
return (file->f_pos = new);
}
-static ssize_t uhci_proc_read(struct file *file, char
*buf, size_t nbytes
,
- loff_t *ppos)
+static ssize_t uhci_proc_read(struct file *file, char
__user *buf
,
+
size_t nbytes,
loff_t *ppos)
{
struct uhci_proc *up = file->private_data;
unsigned int pos;
{
struct uhci_proc *up = file->private_data;
unsigned int pos;
@@
-578,14
+578,9
@@
static ssize_t uhci_proc_read(struct file *file, char *buf, size_t nbytes,
size = up->size;
if (pos >= size)
return 0;
size = up->size;
if (pos >= size)
return 0;
- if (nbytes >= size)
- nbytes = size;
- if (pos + nbytes > size)
+ if (nbytes > size - pos)
nbytes = size - pos;
nbytes = size - pos;
- if (!access_ok(VERIFY_WRITE, buf, nbytes))
- return -EINVAL;
-
if (copy_to_user(buf, up->data + pos, nbytes))
return -EFAULT;
if (copy_to_user(buf, up->data + pos, nbytes))
return -EFAULT;