aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-08-12 10:55:15 +0800
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2022-09-20 11:24:30 +0100
commit98d67f250472cdd0f8d083830be3ec9dbb0c65a8 (patch)
tree6a4183592d192663629b10e8b91160a43faea074 /drivers/hid
parentHID: logitech-hidpp: Detect hi-res scrolling support (diff)
downloadlinux-dev-98d67f250472cdd0f8d083830be3ec9dbb0c65a8.tar.xz
linux-dev-98d67f250472cdd0f8d083830be3ec9dbb0c65a8.zip
hid: hid-logitech-hidpp: avoid unnecessary assignments in hidpp_connect_event
hidpp->delayed_input can't be assigned to an object that already call input_free_device when input_register_device fails. Fixes: c39e3d5fc9dd ("HID: logitech-hidpp: late bind the input device on wireless connection") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20220812025515.19467-1-hbh25y@gmail.com
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-logitech-hidpp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 5f8261c7b74c..71a9c258a20b 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4007,8 +4007,10 @@ static void hidpp_connect_event(struct hidpp_device *hidpp)
hidpp_populate_input(hidpp, input);
ret = input_register_device(input);
- if (ret)
+ if (ret) {
input_free_device(input);
+ return;
+ }
hidpp->delayed_input = input;
}