tree e8199fcd660b21da698009af21aa987079eb27f4
parent a81e7ecca369afee0b07b4758d8c32542ffc587a
author Christopher Li <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:26 -0700
committer Greg K-H <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:26 -0700
[PATCH] USB: bug fix in usbdevfs
I am sorry that the last patch about 32 bit compat ioctl on
64 bit kernel actually breaks the usbdevfs. That is on the current
BK tree. I am retarded.
Here is the patch to fix it. Tested with USB hard disk and webcam
in both 32bit compatible mode and native 64bit mode.
Again, sorry about that.
From: Christopher Li <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
usb/core/devio.c | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
Index: drivers/usb/core/devio.c
===================================================================
--- 6abfa1d3a86f3a4f355e9dd11e6c8ee158a0202b/drivers/usb/core/devio.c
(mode:100644 sha1:a047bc392983eb3bc36d3b887d2187a7bcdb95fe)
+++ e8199fcd660b21da698009af21aa987079eb27f4/drivers/usb/core/devio.c
(mode:100644 sha1:923e5185c0362dcc2968c47f83c529c7e9398b98)
@@ -1032,15 +1032,15 @@
if (put_user(urb->error_count, &userurb->error_count))
return -EFAULT;
- if (!(usb_pipeisoc(urb->pipe)))
- return 0;
- for (i = 0; i < urb->number_of_packets; i++) {
- if (put_user(urb->iso_frame_desc[i].actual_length,
- &userurb->iso_frame_desc[i].actual_length))
- return -EFAULT;
- if (put_user(urb->iso_frame_desc[i].status,
- &userurb->iso_frame_desc[i].status))
- return -EFAULT;
+ if (usb_pipeisoc(urb->pipe)) {
+ for (i = 0; i < urb->number_of_packets; i++) {
+ if (put_user(urb->iso_frame_desc[i].actual_length,
+ &userurb->iso_frame_desc[i].actual_length))
+ return -EFAULT;
+ if (put_user(urb->iso_frame_desc[i].status,
+ &userurb->iso_frame_desc[i].status))
+ return -EFAULT;
+ }
}
free_async(as);
@@ -1126,7 +1126,7 @@
if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg))
return -EFAULT;
- return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb __user
*)arg)->iso_frame_desc, arg);
+ return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user
*)arg)->iso_frame_desc, arg);
}
static int processcompl_compat(struct async *as, void __user * __user *arg)
@@ -1146,15 +1146,15 @@
if (put_user(urb->error_count, &userurb->error_count))
return -EFAULT;
- if (!(usb_pipeisoc(urb->pipe)))
- return 0;
- for (i = 0; i < urb->number_of_packets; i++) {
- if (put_user(urb->iso_frame_desc[i].actual_length,
- &userurb->iso_frame_desc[i].actual_length))
- return -EFAULT;
- if (put_user(urb->iso_frame_desc[i].status,
- &userurb->iso_frame_desc[i].status))
- return -EFAULT;
+ if (usb_pipeisoc(urb->pipe)) {
+ for (i = 0; i < urb->number_of_packets; i++) {
+ if (put_user(urb->iso_frame_desc[i].actual_length,
+ &userurb->iso_frame_desc[i].actual_length))
+ return -EFAULT;
+ if (put_user(urb->iso_frame_desc[i].status,
+ &userurb->iso_frame_desc[i].status))
+ return -EFAULT;
+ }
}
free_async(as);
@@ -1177,10 +1177,8 @@
{
struct async *as;
- printk("reapurbnblock\n");
if (!(as = async_getcompleted(ps)))
return -EAGAIN;
- printk("reap got as %p\n", as);
return processcompl_compat(as, (void __user * __user *)arg);
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html