diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-04-23 17:52:33 +0200 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-04-23 17:52:33 +0200 |
commit | 7d3879bd5da4cc48f41443dcbfa46fcd72c5a354 (patch) | |
tree | 7fe5823076dff584878ff809217a42cc8c8d4428 /drivers/hid/hid-logitech-hidpp.c | |
parent | 1f87b0cd32b3456d7efdfb017fcf74d0bfe3ec29 (diff) | |
parent | a50e8e2ecc1428df28c748c6af6255eb65faf9f3 (diff) | |
download | linux-7d3879bd5da4cc48f41443dcbfa46fcd72c5a354.tar.bz2 |
Merge branch 'for-5.1/upstream-fixes' into for-5.2/logitech
Diffstat (limited to 'drivers/hid/hid-logitech-hidpp.c')
-rw-r--r-- | drivers/hid/hid-logitech-hidpp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index e5897c292e8c..29395da8f345 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -2107,6 +2107,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index) kfree(data); return -ENOMEM; } + data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue"); + if (!data->wq) { + kfree(data->effect_ids); + kfree(data); + return -ENOMEM; + } + data->hidpp = hidpp; data->feature_index = feature_index; data->version = version; @@ -2151,7 +2158,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index) /* ignore boost value at response.fap.params[2] */ /* init the hardware command queue */ - data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue"); atomic_set(&data->workqueue_size, 0); /* initialize with zero autocenter to get wheel in usable state */ @@ -2604,8 +2610,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size) input_report_rel(mydata->input, REL_Y, v); v = hid_snto32(data[6], 8); - hidpp_scroll_counter_handle_scroll( - &hidpp->vertical_wheel_counter, v); + if (v != 0) + hidpp_scroll_counter_handle_scroll( + &hidpp->vertical_wheel_counter, v); input_sync(mydata->input); } |