diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2021-03-04 05:19:57 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-28 12:07:16 +0200 |
commit | 629775f52692f73ae1a3ebdcdfb0888eaa08e35d (patch) | |
tree | 1fac6a6c85ca4848bdf96dc72c8c45f593382618 | |
parent | e87fd8f564bb4dba662df02a23710373d90296ac (diff) | |
download | linux-stable-629775f52692f73ae1a3ebdcdfb0888eaa08e35d.tar.gz linux-stable-629775f52692f73ae1a3ebdcdfb0888eaa08e35d.tar.bz2 linux-stable-629775f52692f73ae1a3ebdcdfb0888eaa08e35d.zip |
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 ed9c0ea5b026..1bc6ad0339d2 100644 --- a/drivers/hid/hid-alps.c +++ b/drivers/hid/hid-alps.c @@ -429,6 +429,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) ret = input_register_device(data->input2); if (ret) { input_free_device(input2); + ret = -ENOENT; goto exit; } } |