Skip to content

Commit

Permalink
hid: hid-logitech-hidpp: avoid unnecessary assignments in hidpp_conne…
Browse files Browse the repository at this point in the history
…ct_event

hidpp->delayed_input can't be assigned to an object that already call
input_free_device when input_register_device fails.

Fixes: c39e3d5 ("HID: logitech-hidpp: late bind the input device on wireless connection")
Signed-off-by: Hangyu Hua <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
HBh25Y authored and bentiss committed Sep 20, 2022
1 parent 908d325 commit 98d67f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hid/hid-logitech-hidpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 98d67f2

Please sign in to comment.