On Thu Sep 17 09:54:43 2026 +0000, Wentao Liang wrote:
> au0828_media_device_init() takes a reference to a media device with
> media_device_usb_allocate().  When au0828_v4l2_device_register()
> fails right after, the error path only unregisters the entities and
> frees au0828_dev, so that reference is never released.
> 
> Release it with media_device_delete() on that path.
> 
> Fixes: 812658d88d26 ("media: change au0828 to use Media Device Allocator API")
> Cc: [email protected]
> Signed-off-by: Wentao Liang <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/usb/au0828/au0828-core.c | 4 ++++
 1 file changed, 4 insertions(+)

---

diff --git a/drivers/media/usb/au0828/au0828-core.c 
b/drivers/media/usb/au0828/au0828-core.c
index 445cbeb7abae..c3826b3b8a2e 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -697,6 +697,10 @@ static int au0828_usb_probe(struct usb_interface 
*interface,
        retval = au0828_v4l2_device_register(interface, dev);
        if (retval) {
                au0828_usb_v4l2_media_release(dev);
+#ifdef CONFIG_MEDIA_CONTROLLER
+               media_device_delete(dev->media_dev, KBUILD_MODNAME,
+                                   THIS_MODULE);
+#endif
                mutex_unlock(&dev->lock);
                kfree(dev);
                return retval;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to