Skip to content

Commit

Permalink
HID: alps: fix error return code in alps_input_configured()
Browse files Browse the repository at this point in the history
[ Upstream commit fa8ba6e ]

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: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
XidianGeneral authored and gregkh committed Apr 28, 2021
1 parent 1cf8067 commit bf9c9d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)

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

0 comments on commit bf9c9d6

Please sign in to comment.