Skip to content

Commit 8d2e77b

Browse files
tititiou36Jiri Kosina
authored andcommitted
HID: alps: Fix an error handling path in 'alps_input_configured()'
They are issues: - if 'input_allocate_device()' fails and return NULL, there is no need to free anything and 'input_free_device()' call is a no-op. It can be axed. - 'ret' is known to be 0 at this point, so we must set it to a meaningful value before returning Fixes: 2562756 ("HID: add Alps I2C HID Touchpad-Stick support") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 5c02c44 commit 8d2e77b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-alps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
730730
if (data->has_sp) {
731731
input2 = input_allocate_device();
732732
if (!input2) {
733-
input_free_device(input2);
733+
ret = -ENOMEM;
734734
goto exit;
735735
}
736736

0 commit comments

Comments
 (0)