[PATCH] media: msi2500: free controls when video registration fails

From: Yousef Alhouseen

Date: Sat Jun 27 2026 - 21:01:31 EST


The control handler has already allocated its control array and copied
the subdevice controls when video_register_device() is called. Its error
path currently skips err_free_controls, leaking those allocations each
time device probing reaches this failure.

Route the failure through the control cleanup label.

Fixes: 977e444f59ad ("[media] Mirics MSi3101 SDR Dongle driver")
Reported-by: syzbot+b1de0d5fd8a15fac11aa@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: https://syzkaller.appspot.com/bug?extid=b1de0d5fd8a15fac11aa
Signed-off-by: Yousef Alhouseen <alhouseenyousef@xxxxxxxxx>
---
drivers/media/usb/msi2500/msi2500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c
index 282256ab812a..2a2773722172 100644
--- a/drivers/media/usb/msi2500/msi2500.c
+++ b/drivers/media/usb/msi2500/msi2500.c
@@ -1280,7 +1280,7 @@ static int msi2500_probe(struct usb_interface *intf,
if (ret) {
dev_err(dev->dev,
"Failed to register as video device (%d)\n", ret);
- goto err_unregister_v4l2_dev;
+ goto err_free_controls;
}
dev_info(dev->dev, "Registered as %s\n",
video_device_node_name(&dev->vdev));
--
2.54.0