]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: i2c/tw9906: Fix potential memory leak in tw9906_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Tue, 23 Dec 2025 05:49:01 +0000 (11:19 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 13 Jan 2026 12:21:04 +0000 (13:21 +0100)
commitcad237b6c875fbee5d353a2b289e98d240d17ec8
treeb9268ea95a219ef339d581fc3e3d4bce4b43f76a
parent9cea16fea47e5553f51d10957677ff735b1eff03
media: i2c/tw9906: Fix potential memory leak in tw9906_probe()

In one of the error paths in tw9906_probe(), the memory allocated in
v4l2_ctrl_handler_init() and v4l2_ctrl_new_std() is not freed. Fix that
by calling v4l2_ctrl_handler_free() on the handler in that error path.

Cc: stable@vger.kernel.org
Fixes: a000e9a02b58 ("[media] tw9906: add Techwell tw9906 video decoder")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/tw9906.c