Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46a41b51 authored by Wei Yongjun's avatar Wei Yongjun Committed by Jiri Kosina
Browse files

HID: alps: fix error return code in alps_input_configured()



Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

While at it, remove redundant input_free_device(NULL) call.

[jkosina@suse.cz: ammend changelog]
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 3da30bfc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)

		input2 = input_allocate_device();
		if (!input2) {
			input_free_device(input2);
			ret = -ENOMEM;
			goto exit;
		}

@@ -425,7 +425,8 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
		__set_bit(INPUT_PROP_POINTER, input2->propbit);
		__set_bit(INPUT_PROP_POINTING_STICK, input2->propbit);

		if (input_register_device(data->input2)) {
		ret = input_register_device(data->input2);
		if (ret) {
			input_free_device(input2);
			goto exit;
		}