Skip to content

Commit 9c730fe

Browse files
committed
Merge tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - fix for memory leak (on error path) in Hyper-V driver (Yang Yingliang) - regression fix for handling 3rd barrel switch emulation in Wacom driver (Jason Gerecke) * tag 'for-linus-2022111101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: wacom: Fix logic used for 3rd barrel switch emulation HID: hyperv: fix possible memory leak in mousevsc_probe() HID: asus: Remove unused variable in asus_report_tool_width()
2 parents 64b4aef + f77810f commit 9c730fe

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

drivers/hid/hid-asus.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,13 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat)
219219
{
220220
struct input_mt *mt = drvdat->input->mt;
221221
struct input_mt_slot *oldest;
222-
int oldid, count, i;
222+
int oldid, i;
223223

224224
if (drvdat->tp->contact_size < 5)
225225
return;
226226

227227
oldest = NULL;
228228
oldid = mt->trkid;
229-
count = 0;
230229

231230
for (i = 0; i < mt->num_slots; ++i) {
232231
struct input_mt_slot *ps = &mt->slots[i];
@@ -238,7 +237,6 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat)
238237
oldest = ps;
239238
oldid = id;
240239
}
241-
count++;
242240
}
243241

244242
if (oldest) {

drivers/hid/hid-hyperv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int mousevsc_probe(struct hv_device *device,
499499

500500
ret = hid_add_device(hid_dev);
501501
if (ret)
502-
goto probe_err1;
502+
goto probe_err2;
503503

504504

505505
ret = hid_parse(hid_dev);

drivers/hid/wacom_wac.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,11 +2520,12 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
25202520

25212521
if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) {
25222522
int id = wacom_wac->id[0];
2523-
if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3 &&
2524-
wacom_wac->hid_data.barrelswitch & wacom_wac->hid_data.barrelswitch2) {
2525-
wacom_wac->hid_data.barrelswitch = 0;
2526-
wacom_wac->hid_data.barrelswitch2 = 0;
2527-
wacom_wac->hid_data.barrelswitch3 = 1;
2523+
if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3) {
2524+
int sw_state = wacom_wac->hid_data.barrelswitch |
2525+
(wacom_wac->hid_data.barrelswitch2 << 1);
2526+
wacom_wac->hid_data.barrelswitch = sw_state == 1;
2527+
wacom_wac->hid_data.barrelswitch2 = sw_state == 2;
2528+
wacom_wac->hid_data.barrelswitch3 = sw_state == 3;
25282529
}
25292530
input_report_key(input, BTN_STYLUS, wacom_wac->hid_data.barrelswitch);
25302531
input_report_key(input, BTN_STYLUS2, wacom_wac->hid_data.barrelswitch2);

0 commit comments

Comments
 (0)