# \[PATCH 1/1\] Input: hil\_kbd - Fix error return code in hil\_dev\_connect()

- Subsystems: INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS, THE REST
- Maintainers: Dmitry Torokhov, Linus Torvalds
- Status: LANDED (d9b576917a1d · 2021-05-25 03:57)
- Landed in mainline as d9b576917a1d on 2021-05-25.
- List: linux-input
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2021/05/8933008/t

## \[PATCH 1/1\] Input: hil\_kbd - Fix error return code in hil\_dev\_connect()

- From: Zhen Lei \<hidden\>
- Date: 2021-05-15 03:01:14 
- Message: https://ratatoskr.run/linux-input/2021/05/8933008.md

```text
Return error code -EPERM rather than '0' when the combo devices are not
supported.

Fixes: fa71c605c2bb ("Input: combine hil_kbd and hil_ptr drivers")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Zhen Lei <redacted>
---
 drivers/input/keyboard/hil_kbd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index bb29a7c9a1c0cf5..ca38e8e20bb5484 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -512,6 +512,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv)
 		    HIL_IDD_NUM_AXES_PER_SET(*idd)) {
 			printk(KERN_INFO PREFIX
 				"combo devices are not supported.\n");
+			error = -EPERM;
 			goto bail1;
 		}
 
-- 
2.26.0.106.g9fadedd


```

## Re: \[PATCH 1/1\] Input: hil\_kbd - Fix error return code in hil\_dev\_connect()

- From: Dmitry Torokhov \<dmitry.torokhov@gmail.com\>
- Date: 2021-05-25 03:37:07 
- Message: https://ratatoskr.run/linux-input/2021/05/8933054.md

```text
Hi Zhen,

On Sat, May 15, 2021 at 11:00:53AM +0800, Zhen Lei wrote:
> Return error code -EPERM rather than '0' when the combo devices are not

I believe -EINVAL suits better here, so I used it and applied, thank
you.

Thanks.

-- 
Dmitry
```
