Re: [PATCH v3 4/4] media: renesas: rzg2l-core: Add missing media_entity_cleanup()
From: Jacopo Mondi
Date: Wed Jul 08 2026 - 12:30:00 EST
On Sat, Jul 04, 2026 at 11:16:43PM +0530, Biren Pandya wrote:
> The remove function fails to call media_entity_cleanup() upon teardown.
>
> While currently a no-op in most cases, calling media_entity_cleanup()
> is an API requirement for entities initialized with media_entity_pads_init()
> to prevent memory leaks.
>
> Add the missing media_entity_cleanup() call in rzg2l_cru_remove().
Same comments as per the other patches
> Signed-off-by: Biren Pandya <birenpandya@xxxxxxxxx>
> ---
> drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
> index 3c5fbd857371..84d4883e2fe7 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c
While at it, you could consider patching the error path in
rzg2l_cru_media_init()
Thanks
j
> @@ -312,6 +312,7 @@ static void rzg2l_cru_remove(struct platform_device *pdev)
> v4l2_async_nf_cleanup(&cru->notifier);
>
> rzg2l_cru_video_unregister(cru);
> + media_entity_cleanup(&cru->vdev.entity);
> media_device_cleanup(&cru->mdev);
> mutex_destroy(&cru->mdev_lock);
>
> --
> 2.50.1 (Apple Git-155)
>
>