diff options
author | Christopher Li <chrisl@vmware.com> | 2005-04-18 20:39:26 -0400 |
---|---|---|
committer | Greg K-H <gregkh@suse.de> | 2005-04-18 20:39:26 -0400 |
commit | 668a9541a56af5ebb3ad0babdc2cd73511c9e1e9 (patch) | |
tree | e8199fcd660b21da698009af21aa987079eb27f4 /drivers/usb | |
parent | a81e7ecca369afee0b07b4758d8c32542ffc587a (diff) |
[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 <chrisl@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devio.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index a047bc392983..923e5185c036 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1032,15 +1032,15 @@ static int processcompl(struct async *as, void __user * __user *arg) | |||
1032 | if (put_user(urb->error_count, &userurb->error_count)) | 1032 | if (put_user(urb->error_count, &userurb->error_count)) |
1033 | return -EFAULT; | 1033 | return -EFAULT; |
1034 | 1034 | ||
1035 | if (!(usb_pipeisoc(urb->pipe))) | 1035 | if (usb_pipeisoc(urb->pipe)) { |
1036 | return 0; | 1036 | for (i = 0; i < urb->number_of_packets; i++) { |
1037 | for (i = 0; i < urb->number_of_packets; i++) { | 1037 | if (put_user(urb->iso_frame_desc[i].actual_length, |
1038 | if (put_user(urb->iso_frame_desc[i].actual_length, | 1038 | &userurb->iso_frame_desc[i].actual_length)) |
1039 | &userurb->iso_frame_desc[i].actual_length)) | 1039 | return -EFAULT; |
1040 | return -EFAULT; | 1040 | if (put_user(urb->iso_frame_desc[i].status, |
1041 | if (put_user(urb->iso_frame_desc[i].status, | 1041 | &userurb->iso_frame_desc[i].status)) |
1042 | &userurb->iso_frame_desc[i].status)) | 1042 | return -EFAULT; |
1043 | return -EFAULT; | 1043 | } |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | free_async(as); | 1046 | free_async(as); |
@@ -1126,7 +1126,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg) | |||
1126 | if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) | 1126 | if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) |
1127 | return -EFAULT; | 1127 | return -EFAULT; |
1128 | 1128 | ||
1129 | return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb __user *)arg)->iso_frame_desc, arg); | 1129 | return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg); |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | static int processcompl_compat(struct async *as, void __user * __user *arg) | 1132 | static int processcompl_compat(struct async *as, void __user * __user *arg) |
@@ -1146,15 +1146,15 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) | |||
1146 | if (put_user(urb->error_count, &userurb->error_count)) | 1146 | if (put_user(urb->error_count, &userurb->error_count)) |
1147 | return -EFAULT; | 1147 | return -EFAULT; |
1148 | 1148 | ||
1149 | if (!(usb_pipeisoc(urb->pipe))) | 1149 | if (usb_pipeisoc(urb->pipe)) { |
1150 | return 0; | 1150 | for (i = 0; i < urb->number_of_packets; i++) { |
1151 | for (i = 0; i < urb->number_of_packets; i++) { | 1151 | if (put_user(urb->iso_frame_desc[i].actual_length, |
1152 | if (put_user(urb->iso_frame_desc[i].actual_length, | 1152 | &userurb->iso_frame_desc[i].actual_length)) |
1153 | &userurb->iso_frame_desc[i].actual_length)) | 1153 | return -EFAULT; |
1154 | return -EFAULT; | 1154 | if (put_user(urb->iso_frame_desc[i].status, |
1155 | if (put_user(urb->iso_frame_desc[i].status, | 1155 | &userurb->iso_frame_desc[i].status)) |
1156 | &userurb->iso_frame_desc[i].status)) | 1156 | return -EFAULT; |
1157 | return -EFAULT; | 1157 | } |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | free_async(as); | 1160 | free_async(as); |
@@ -1177,10 +1177,8 @@ static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg) | |||
1177 | { | 1177 | { |
1178 | struct async *as; | 1178 | struct async *as; |
1179 | 1179 | ||
1180 | printk("reapurbnblock\n"); | ||
1181 | if (!(as = async_getcompleted(ps))) | 1180 | if (!(as = async_getcompleted(ps))) |
1182 | return -EAGAIN; | 1181 | return -EAGAIN; |
1183 | printk("reap got as %p\n", as); | ||
1184 | return processcompl_compat(as, (void __user * __user *)arg); | 1182 | return processcompl_compat(as, (void __user * __user *)arg); |
1185 | } | 1183 | } |
1186 | 1184 | ||