diff mbox series

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

Message ID 1607070370-32319-1-git-send-email-zhangchangzhong@huawei.com (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series HID: alps: fix error return code in alps_input_configured() | expand

Commit Message

Zhang Changzhong Dec. 4, 2020, 8:26 a.m. UTC
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: c7083d3f5348 ("HID: alps: properly handle max_fingers and minimum on X and Y axis")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
 drivers/hid/hid-alps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index 3feaece..17782a6 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -759,7 +759,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) {
 			goto exit;