Commit fa8ba6e5 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Jiri Kosina

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

When input_register_device() fails, no error return code is assigned.
To fix this bug, ret is assigned with -ENOENT as error return code.
Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9a0b44fb
...@@ -761,6 +761,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) ...@@ -761,6 +761,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
if (input_register_device(data->input2)) { if (input_register_device(data->input2)) {
input_free_device(input2); input_free_device(input2);
ret = -ENOENT;
goto exit; goto exit;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment