hid: hid-alps: fix error return code in alps_input_configured()
PATCH 1/1 hid: 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 TOTE Robot <[email protected]>
Signed-off-by Jia-Ju Bai <[email protected]>
--- drivers/hid/hid-alps.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/hid-alps.c +1 -0
@@ -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; } }
Signature · 1 line
2.17.1
Quoted 14 lines · Jia-Ju Bai
When
input_register_device()fails, no error return code is assigned. To fix this bug, ret is assigned with-ENOENTas error return code.Reported-by TOTE Robot <[email protected]>Signed-off-by Jia-Ju Bai <[email protected]>--- drivers/hid/hid-alps.c | 1 + 1 file changed, 1 insertion(+)drivers/hid/hid-alps.c +0
-0
drivers/hid/hid-alps.c static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) · line 767
Quoted 7 lines
drivers/hid/hid-alps.c +1
-0@@ -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; } }
Applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs