Skip to contentSkip to conversation

hid: hid-alps: fix error return code in alps_input_configured()

PATCH Applied Jia-Ju Bai 2 participants 2 messages Mar 4, 2021 – Mar 8, 2021 HID

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

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.

---
 drivers/hid/hid-alps.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-alps.c +1 -0
index 3feaece13ade..6b665931147d 100644
@@ -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
maintainer Applied
#1 lore raw
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 -ENOENT as error return code.

---
 drivers/hid/hid-alps.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-alps.c +0 -0
index 3feaece13ade..6b665931147d 100644

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