]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: radio-keene: fix memory leak in error path
authorShaurya Rane <ssrane_b23@ee.vjti.ac.in>
Wed, 26 Nov 2025 19:04:10 +0000 (00:34 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 13 Jan 2026 12:21:03 +0000 (13:21 +0100)
commitb8bf939d77c0cd01118e953bbf554e0fa15e9006
tree1a5945b9e5346028ff7442bae79549ab3f9f6c75
parent90289b67c5c1d4c18784059b27460d292e16d208
media: radio-keene: fix memory leak in error path

Fix a memory leak in usb_keene_probe(). The v4l2 control handler is
initialized and controls are added, but if v4l2_device_register() or
video_register_device() fails afterward, the handler was never freed,
leaking memory.

Add v4l2_ctrl_handler_free() call in the err_v4l2 error path to ensure
the control handler is properly freed for all error paths after it is
initialized.

Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
Fixes: 1bf20c3a0c61 ("[media] radio-keene: add a driver for the Keene FM Transmitter")
Cc: stable@vger.kernel.org
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/radio/radio-keene.c