[PATCH v3 3/4] media: renesas: rcar-core: Add missing media_entity_cleanup()
From: Biren Pandya
Date: Mon Jun 22 2026 - 13:34:18 EST
The probe error path and remove function are missing calls to
media_entity_cleanup(). Add a dedicated err_entity label so the
cleanup is only invoked when media_entity_pads_init() has actually
succeeded. This ensures that the teardown logic properly mirrors
initialization.
Signed-off-by: Biren Pandya <birenpandya@xxxxxxxxx>
---
drivers/media/platform/renesas/rcar-vin/rcar-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
index c8d564aa1eba..5bae8eb0ee19 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
@@ -1211,7 +1211,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
ret = rvin_create_controls(vin);
if (ret < 0)
- goto err_id;
+ goto err_entity;
switch (vin->info->model) {
case RCAR_GEN3:
@@ -1246,6 +1246,8 @@ static int rcar_vin_probe(struct platform_device *pdev)
err_ctrl:
rvin_free_controls(vin);
+err_entity:
+ media_entity_cleanup(&vin->vdev.entity);
err_id:
rvin_id_put(vin);
err_dma:
@@ -1270,6 +1272,7 @@ static void rcar_vin_remove(struct platform_device *pdev)
rvin_group_put(vin);
rvin_free_controls(vin);
+ media_entity_cleanup(&vin->vdev.entity);
rvin_id_put(vin);
--
2.50.1 (Apple Git-155)