[patch] bug fix in usbdevfs

From: Christopher Li (chrisl_at_vmware.com)
Date: 03/31/05

  • Next message: Dave Jones: "Re: BK snapshots removed from kernel.org?"
    Date:	Wed, 30 Mar 2005 19:51:23 -0500
    To: linux kernel mail list <linux-kernel@vger.kernel.org>
    
    

    Hi,

    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.

    Chris

    Index: linux-2.5/drivers/usb/core/devio.c
    ===================================================================
    --- linux-2.5.orig/drivers/usb/core/devio.c 2005-03-30 18:19:50.000000000 -0800
    +++ linux-2.5/drivers/usb/core/devio.c 2005-03-30 19:35:31.000000000 -0800
    @@ -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 linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Dave Jones: "Re: BK snapshots removed from kernel.org?"

    Relevant Pages

    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test8/test9 io scheduler needs tuning?
      ... interactivity with regard to desktop use. ... Going to improve the time info output of the ddd loops to get better data and ... with the patch the hang reported earlier was not encountered again so ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [CFT][PATCH] 2.6.4-rc1 remove x86 boot page tables
      ... > For VISWS I think you actually need to turn paging off explicitly. ... The patch will need a few tweaks but it should be fairly straight forward. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] clarify message and give support contact for non-GPL modules
      ... The author of the second module ... So here is another attempt at the patch. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)