Skip to contentSkip to conversation

media: msi2500: free controls when video registration fails

PATCH New Yousef Alhouseen 1 participant 1 message Jun 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: msi2500: free controls when video registration fails

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 [email protected]
---
 drivers/media/usb/msi2500/msi2500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/msi2500/msi2500.c +1 -1
index 282256ab812a..2a2773722172 100644
@@ -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));
Signature · 1 line
2.54.0