Skip to content

Commit 1bbee7d

Browse files
committed
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: Add Cando touch screen 15.6-inch product id HID: Add MULTI_INPUT quirk for turbox/mosart touchscreen HID: hidraw, fix a NULL pointer dereference in hidraw_write HID: hidraw, fix a NULL pointer dereference in hidraw_ioctl
2 parents 264780c + 272036e commit 1bbee7d

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

drivers/hid/hid-cando.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ static const struct hid_device_id cando_devices[] = {
237237
USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
238238
{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
239239
USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
240+
{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
241+
USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
240242
{ }
241243
};
242244
MODULE_DEVICE_TABLE(hid, cando_devices);

drivers/hid/hid-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ static const struct hid_device_id hid_blacklist[] = {
12921292
{ HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
12931293
{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
12941294
{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
1295+
{ HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
12951296
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
12961297
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },
12971298
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },

drivers/hid/hid-ids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
#define USB_VENDOR_ID_CANDO 0x2087
135135
#define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01
136136
#define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03
137+
#define USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6 0x0f01
137138

138139
#define USB_VENDOR_ID_CH 0x068e
139140
#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
@@ -503,6 +504,7 @@
503504

504505
#define USB_VENDOR_ID_TURBOX 0x062a
505506
#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201
507+
#define USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART 0x7100
506508

507509
#define USB_VENDOR_ID_TWINHAN 0x6253
508510
#define USB_DEVICE_ID_TWINHAN_IR_REMOTE 0x0100

drivers/hid/hidraw.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t
109109
int ret = 0;
110110

111111
mutex_lock(&minors_lock);
112+
113+
if (!hidraw_table[minor]) {
114+
ret = -ENODEV;
115+
goto out;
116+
}
117+
112118
dev = hidraw_table[minor]->hid;
113119

114120
if (!dev->hid_output_raw_report) {
@@ -244,6 +250,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
244250

245251
mutex_lock(&minors_lock);
246252
dev = hidraw_table[minor];
253+
if (!dev) {
254+
ret = -ENODEV;
255+
goto out;
256+
}
247257

248258
switch (cmd) {
249259
case HIDIOCGRDESCSIZE:
@@ -317,6 +327,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
317327

318328
ret = -ENOTTY;
319329
}
330+
out:
320331
mutex_unlock(&minors_lock);
321332
return ret;
322333
}

drivers/hid/usbhid/hid-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static const struct hid_blacklist {
3636
{ USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
3737
{ USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT },
3838
{ USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT },
39+
{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT },
3940
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
4041
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
4142
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },

0 commit comments

Comments
 (0)