diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-08-12 22:48:01 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-12 22:48:01 -0400 |
commit | e290861f99131fc42d98012a9ea2dc185f08f8f9 (patch) | |
tree | 5c8b92d095d74d03b281711c81bac54bd59989cd /drivers/usb/core/devio.c | |
parent | b4a757367d36cebddcd332a4024d92f1e87af370 (diff) | |
parent | dbefd606a3b3634799b625f4900336e61c89e868 (diff) |
Merge branch 'sh/stable-updates'
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r-- | drivers/usb/core/devio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38b8bce782d6..4247eccf858c 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -595,7 +595,7 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
595 | if (!ps) | 595 | if (!ps) |
596 | goto out; | 596 | goto out; |
597 | 597 | ||
598 | ret = -ENOENT; | 598 | ret = -ENODEV; |
599 | 599 | ||
600 | /* usbdev device-node */ | 600 | /* usbdev device-node */ |
601 | if (imajor(inode) == USB_DEVICE_MAJOR) | 601 | if (imajor(inode) == USB_DEVICE_MAJOR) |
@@ -1321,7 +1321,8 @@ static int get_urb32(struct usbdevfs_urb *kurb, | |||
1321 | struct usbdevfs_urb32 __user *uurb) | 1321 | struct usbdevfs_urb32 __user *uurb) |
1322 | { | 1322 | { |
1323 | __u32 uptr; | 1323 | __u32 uptr; |
1324 | if (get_user(kurb->type, &uurb->type) || | 1324 | if (!access_ok(VERIFY_READ, uurb, sizeof(*uurb)) || |
1325 | __get_user(kurb->type, &uurb->type) || | ||
1325 | __get_user(kurb->endpoint, &uurb->endpoint) || | 1326 | __get_user(kurb->endpoint, &uurb->endpoint) || |
1326 | __get_user(kurb->status, &uurb->status) || | 1327 | __get_user(kurb->status, &uurb->status) || |
1327 | __get_user(kurb->flags, &uurb->flags) || | 1328 | __get_user(kurb->flags, &uurb->flags) || |
@@ -1536,8 +1537,9 @@ static int proc_ioctl_compat(struct dev_state *ps, compat_uptr_t arg) | |||
1536 | u32 udata; | 1537 | u32 udata; |
1537 | 1538 | ||
1538 | uioc = compat_ptr((long)arg); | 1539 | uioc = compat_ptr((long)arg); |
1539 | if (get_user(ctrl.ifno, &uioc->ifno) || | 1540 | if (!access_ok(VERIFY_READ, uioc, sizeof(*uioc)) || |
1540 | get_user(ctrl.ioctl_code, &uioc->ioctl_code) || | 1541 | __get_user(ctrl.ifno, &uioc->ifno) || |
1542 | __get_user(ctrl.ioctl_code, &uioc->ioctl_code) || | ||
1541 | __get_user(udata, &uioc->data)) | 1543 | __get_user(udata, &uioc->data)) |
1542 | return -EFAULT; | 1544 | return -EFAULT; |
1543 | ctrl.data = compat_ptr(udata); | 1545 | ctrl.data = compat_ptr(udata); |