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: c39e3d5fc9 ("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
This commit is contained in:
Hangyu Hua 2022-08-12 10:55:15 +08:00 committed by Benjamin Tissoires
parent 908d325e16
commit 98d67f2504

View File

@ -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;
}