# \[PATCH\] Input: sur40 - Fix an error code in sur40\_probe()

- Subsystems: INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS, THE REST
- Maintainers: Dmitry Torokhov, Linus Torvalds
- Status: LANDED (b0b7d2815839 · 2021-02-17 04:39)
- Landed in mainline as b0b7d2815839 on 2021-02-17.
- List: linux-input
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2021/01/8932494/t

## \[PATCH\] Input: sur40 - Fix an error code in sur40\_probe()

- From: Dan Carpenter \<hidden\>
- Date: 2021-01-28 09:40:44 
- Message: https://ratatoskr.run/linux-input/2021/01/8932494.md

```text
If v4l2_ctrl_handler_setup() fails then probe() should return an error
code instead of returning success.

Fixes: cee1e3e2ef39 ("media: add video control handlers using V4L2 control framework")
Signed-off-by: Dan Carpenter <redacted>
---
 drivers/input/touchscreen/sur40.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 620cdd7d214a..12f2562b0141 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -787,6 +787,7 @@ static int sur40_probe(struct usb_interface *interface,
 		dev_err(&interface->dev,
 			"Unable to register video controls.");
 		v4l2_ctrl_handler_free(&sur40->hdl);
+		error = sur40->hdl.error;
 		goto err_unreg_v4l2;
 	}
 
-- 
2.29.2

```

## Re: \[PATCH\] Input: sur40 - Fix an error code in sur40\_probe()

- From: Dmitry Torokhov \<dmitry.torokhov@gmail.com\>
- Date: 2021-02-17 04:38:48 
- Message: https://ratatoskr.run/linux-input/2021/02/8932627.md

```text
On Thu, Jan 28, 2021 at 12:36:17PM +0300, Dan Carpenter wrote:
> If v4l2_ctrl_handler_setup() fails then probe() should return an error
> code instead of returning success.
> 
> Fixes: cee1e3e2ef39 ("media: add video control handlers using V4L2 control framework")
> Signed-off-by: Dan Carpenter <redacted>

Applied, thank you.

-- 
Dmitry
```
