]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Input: sur40 - fix V4L error path cleanup
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 16 Jun 2026 05:12:30 +0000 (22:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 13 Aug 2026 00:51:54 +0000 (17:51 -0700)
commit062dc4693e2c10d77de06f61e6f3faf37c0a8383
tree4cdc8afe1955b2bcc7006438039cd6bc335ceaa6
parent9da976eb649c9e2f588a4499410e4d8af687925f
Input: sur40 - fix V4L error path cleanup

In sur40_probe(), if video_register_device() fails, the error path jumps to
err_unreg_video. This incorrectly attempts to unregister a video device
that was never successfully registered, and fails to free the V4L2 control
handler (v4l2_ctrl_handler_free) that was initialized immediately prior.

Fix this by introducing an err_free_ctrl label to properly free the V4L2
control handler and bypass video_unregister_device() when video device
registration fails.

Reported-by: sashiko-bot@kernel.org
Cc: stable@vger.kernel.org
Assisted-by: Antigravity:gemini-3.5-flash
Link: https://patch.msgid.link/20260616051235.1549517-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/sur40.c