diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2021-03-04 16:19:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-28 14:40:01 +0300 |
commit | f691dc86411d80005dcf26fedd5c95c834a9da09 (patch) | |
tree | ed5e6beb2c6f3d6663d6d7f66b336091eb322039 | |
parent | 079e32723f78ef814f3973b4598b581275463836 (diff) | |
download | linux-f691dc86411d80005dcf26fedd5c95c834a9da09.tar.xz |
HID: alps: fix error return code in alps_input_configured()
[ Upstream commit fa8ba6e5dc0e78e409e503ddcfceef5dd96527f4 ]
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>
-rw-r--r-- | drivers/hid/hid-alps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c index 3feaece13ade..6b665931147d 100644 --- a/drivers/hid/hid-alps.c +++ b/drivers/hid/hid-alps.c @@ -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; } } |