1. 29 Oct, 2008 2 commits
    • Chris Malley's avatar
      USB: usbtmc: Use explicit unsigned type for input buffer instead of char* · b361a6e3
      Chris Malley authored
      Silences compiler warning about comparison with 0x80, and type now matches the
      corresponding _bulk_out function.
      
      drivers/usb/class/usbtmc.c: In function ‘usbtmc_ioctl_abort_bulk_in’:
      drivers/usb/class/usbtmc.c:163: warning: comparison is always false due to limited range of data type
      Signed-off-by: default avatarChris Malley <mail@chrismalley.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b361a6e3
    • Alan Stern's avatar
      USB: fix crash when URBs are unlinked after the device is gone · cde217a5
      Alan Stern authored
      This patch (as1151) protects usbcore against drivers that try to
      unlink an URB after the URB's device or bus have been removed.  The
      core does not currently check for this, and certain drivers can cause
      a crash if they are running while an HCD is unloaded.
      
      Certainly it would be best to fix the guilty drivers.  But a little
      defensive programming doesn't hurt, especially since it appears that
      quite a few drivers need to be fixed.
      
      The patch prevents the problem by grabbing a reference to the device
      while an unlink is in progress and using a new spinlock to synchronize
      unlinks with device removal.  (There's no need to acquire a reference
      to the bus as well, since the device structure itself keeps a
      reference to the bus.)  In addition, the kerneldoc is updated to
      indicate that URBs should not be unlinked after the disconnect method
      returns.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cde217a5
  2. 28 Oct, 2008 38 commits