Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: fix oops in hid_check_keys_pressed() HID: fix possible deadlock in usbhid_close() HID: Fix the support for apple mini aluminium keyboard HID: Add support for the G25 force feedback wheel in native mode HID: hidraw -- fix missing unlocks in unlocked_ioctl
This commit is contained in:
Коммит
020f932bd2
|
@ -151,7 +151,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
|||
if (fnmode) {
|
||||
int do_translate;
|
||||
|
||||
trans = apple_find_translation((hid->product < 0x220 ||
|
||||
trans = apple_find_translation((hid->product < 0x21d ||
|
||||
hid->product >= 0x300) ?
|
||||
powerbook_fn_keys : apple_fn_keys,
|
||||
usage->code);
|
||||
|
|
|
@ -1293,6 +1293,7 @@ static const struct hid_device_id hid_blacklist[] = {
|
|||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) },
|
||||
|
@ -1824,6 +1825,9 @@ int hid_check_keys_pressed(struct hid_device *hid)
|
|||
struct hid_input *hidinput;
|
||||
int i;
|
||||
|
||||
if (!(hid->claimed & HID_CLAIMED_INPUT))
|
||||
return 0;
|
||||
|
||||
list_for_each_entry(hidinput, &hid->inputs, list) {
|
||||
for (i = 0; i < BITS_TO_LONGS(KEY_MAX); i++)
|
||||
if (hidinput->input->key[i])
|
||||
|
|
|
@ -292,6 +292,7 @@
|
|||
#define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
|
||||
#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294
|
||||
#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL 0xc295
|
||||
#define USB_DEVICE_ID_LOGITECH_G25_WHEEL 0xc299
|
||||
#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a
|
||||
#define USB_DEVICE_ID_S510_RECEIVER 0xc50c
|
||||
#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517
|
||||
|
|
|
@ -297,6 +297,8 @@ static const struct hid_device_id lg_devices[] = {
|
|||
.driver_data = LG_FF },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),
|
||||
.driver_data = LG_FF },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),
|
||||
.driver_data = LG_FF },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),
|
||||
.driver_data = LG_FF2 },
|
||||
{ }
|
||||
|
|
|
@ -285,8 +285,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
|
|||
|
||||
if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWNAME(0))) {
|
||||
int len;
|
||||
if (!hid->name)
|
||||
return 0;
|
||||
if (!hid->name) {
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
len = strlen(hid->name) + 1;
|
||||
if (len > _IOC_SIZE(cmd))
|
||||
len = _IOC_SIZE(cmd);
|
||||
|
@ -297,8 +299,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
|
|||
|
||||
if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWPHYS(0))) {
|
||||
int len;
|
||||
if (!hid->phys)
|
||||
return 0;
|
||||
if (!hid->phys) {
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
len = strlen(hid->phys) + 1;
|
||||
if (len > _IOC_SIZE(cmd))
|
||||
len = _IOC_SIZE(cmd);
|
||||
|
|
|
@ -662,8 +662,8 @@ void usbhid_close(struct hid_device *hid)
|
|||
spin_lock_irq(&usbhid->lock);
|
||||
if (!--hid->open) {
|
||||
spin_unlock_irq(&usbhid->lock);
|
||||
hid_cancel_delayed_stuff(usbhid);
|
||||
usb_kill_urb(usbhid->urbin);
|
||||
flush_scheduled_work();
|
||||
usbhid->intf->needs_remote_wakeup = 0;
|
||||
} else {
|
||||
spin_unlock_irq(&usbhid->lock);
|
||||
|
|
Загрузка…
Ссылка в новой задаче