From: Dan Carpenter Date: Wed, 17 Feb 2021 04:30:45 +0000 (-0800) Subject: Input: sur40 - fix an error code in sur40_probe() X-Git-Tag: v5.12-rc1~60^2~1^2~15 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b0b7d2815839024e5181bd2572f5d8d4f65363b3;p=linux-2.6-block.git Input: sur40 - fix an error code in sur40_probe() 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 Link: https://lore.kernel.org/r/YBKFkbATXa5fA3xj@mwanda Signed-off-by: Dmitry Torokhov --- 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; }