FAILED: Patch "media: radio-keene: fix memory leak in error path" failed to apply to 6.6-stable tree
Subsystems (3)
Sasha Levin
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From b8bf939d77c0cd01118e953bbf554e0fa15e9006 Mon Sep 17 00:00:00 2001
From: Shaurya Rane <[email protected]>
Date: Thu, 27 Nov 2025 00:34:10 +0530
Subject: [PATCH] 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.
--- drivers/media/radio/radio-keene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/radio/radio-keene.c +1 -1
@@ -338,7 +338,6 @@ static int usb_keene_probe(struct usb_interface *intf,if (hdl->error) { retval = hdl->error; -v4l2_ctrl_handler_free (hdl); goto err_v4l2; } retval =v4l2_device_register (&intf->dev, &radio->v4l2_dev);
@@ -384,6 +383,7 @@ static int usb_keene_probe(struct usb_interface *intf, err_vdev:v4l2_device_unregister (&radio->v4l2_dev); err_v4l2: +v4l2_ctrl_handler_free (&radio->hdl);kfree (radio->buffer);kfree (radio); err:
Signature · 1 line
2.51.0