Re: [PATCH v3 01/10] media: synopsys: hdmirx: free the driver data when the last user is gone

From: Dmitry Osipenko

Date: Wed Oct 07 2026 - 08:11:24 EST


On 10/5/26 16:28, Sascha Hauer wrote:
> @@ -2792,16 +2807,13 @@ static void hdmirx_remove(struct platform_device *pdev)
> hdmirx_disable_irq(dev);
>
> vb2_video_unregister_device(&hdmirx_dev->stream.vdev);
> - v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
> v4l2_device_unregister(&hdmirx_dev->v4l2_dev);
>
> - /* touched by hdmirx_disable()->hdmirx_plugout() */
> - hdmirx_dev->rgb_range = NULL;
> - hdmirx_dev->content_type = NULL;
> -
> hdmirx_disable(dev);
>
> reset_control_bulk_assert(HDMIRX_NUM_RST, hdmirx_dev->resets);
> +
> + v4l2_device_put(&hdmirx_dev->v4l2_dev);
> }

This is uncommon v4l driver removal pattern, I suspect it's either not
correct or needs to be fixed in the core code.

What is the user-visible or sanitizer-visible problem? How to reproduce it?

--
Best regards,
Dmitry