1. 10 Dec, 2010 1 commit
    • Joe Perches's avatar
      HID: Add and use hid_<level>: dev_<level> equivalents · 4291ee30
      Joe Perches authored
      Neaten current uses of dev_<level> by adding and using
      hid specific hid_<level> macros.
      
      Convert existing uses of dev_<level> uses to hid_<level>.
      Convert hid-pidff printk uses to hid_<level>.
      
      Remove err_hid and use hid_err instead.
      
      Add missing newlines to logging messages where necessary.
      Coalesce format strings.
      
      Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt
      
      Other miscellaneous changes:
      
      Add const struct hid_device * argument to hid-core functions
      extract() and implement() so hid_<level> can be used by them.
      Fix bad indentation in hid-core hid_input_field function
      that calls extract() function above.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4291ee30
  2. 08 Dec, 2010 1 commit
  3. 07 Dec, 2010 2 commits
    • Valentine Barshak's avatar
      HID: Consolidate device existence checks in hiddev_ioctl · 33d6eb57
      Valentine Barshak authored
      Currently, if the device has been removed before hiddev_ioctl(),
      the -EIO is returned. If it's removed while hiddev_ioctl() is in
      progress, some commands are still processed fine, others
      return -ENODEV. This change takes the "existancelock" before
      processing ioctl commands and releases it at the end.
      If the device has been removed, always returns -ENODEV.
      Signed-off-by: default avatarValentine Barshak <vbarshak@mvista.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      33d6eb57
    • Valentine Barshak's avatar
      HID: Fix race between disconnect and hiddev_ioctl · 1a8e8fab
      Valentine Barshak authored
      A USB HID device can be disconnected at any time.
      If this happens right before or while hiddev_ioctl is in progress,
      the hiddev_ioctl tries to access invalid hiddev->hid pointer.
      When the hid device is disconnected, the hiddev_disconnect()
      ends up with a call to hid_device_release() which frees
      hid_device, but doesn't set the hiddev->hid pointer to NULL.
      If the deallocated memory region has been re-used by the kernel,
      this can cause a crash or memory corruption.
      
      Since disconnect can happen at any time, we can't initialize
      struct hid_device *hid = hiddev->hid at the beginning of ioctl
      and then use it.
      
      This change checks hiddev->exist flag while holding
      the existancelock and uses hid_device only if it exists.
      Signed-off-by: default avatarValentine Barshak <vbarshak@mvista.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      1a8e8fab
  4. 28 Nov, 2010 1 commit
  5. 25 Nov, 2010 1 commit
  6. 18 Nov, 2010 4 commits
  7. 15 Nov, 2010 1 commit
  8. 03 Nov, 2010 2 commits
  9. 01 Nov, 2010 1 commit
  10. 24 Oct, 2010 26 commits