media: msi2500: free controls when video registration fails
Subsystems (2)
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]
Signed-off-by Yousef Alhouseen <[email protected]>
--- drivers/media/usb/msi2500/msi2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/msi2500/msi2500.c +1 -1
@@ -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