diff mbox series

Input: sur40 - Fix an error code in sur40_probe()

Message ID YBKFkbATXa5fA3xj@mwanda
State Accepted
Commit b0b7d2815839024e5181bd2572f5d8d4f65363b3
Headers show
Series Input: sur40 - Fix an error code in sur40_probe() | expand

Commit Message

Dan Carpenter Jan. 28, 2021, 9:36 a.m. UTC
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 <dan.carpenter@oracle.com>
---
 drivers/input/touchscreen/sur40.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Torokhov Feb. 17, 2021, 4:37 a.m. UTC | #1
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 <dan.carpenter@oracle.com>


Applied, thank you.

-- 
Dmitry
diff mbox series

Patch

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;
 	}