Linux Media Controller development
 help / color / mirror / Atom feed
From: Biren Pandya <birenpandya@gmail.com>
To: linux-media@vger.kernel.org
Cc: "Biren Pandya" <birenpandya@gmail.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>
Subject: [PATCH 3/4] media: renesas: rcar-core: Add missing media_entity_cleanup()
Date: Fri, 19 Jun 2026 15:52:45 +0530	[thread overview]
Message-ID: <20260619102241.22887-9-birenpandya@gmail.com> (raw)
In-Reply-To: <20260619102241.22887-6-birenpandya@gmail.com>

The probe error paths and remove function are missing calls to
media_entity_cleanup(). Add them and introduce an err_entity label
to ensure teardown logic properly inverses initialization.

Signed-off-by: Biren Pandya <birenpandya@gmail.com>
---
 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)


  parent reply	other threads:[~2026-06-19 10:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 10:22 [PATCH 0/4] media: renesas: Add missing media_entity_cleanup() calls Biren Pandya
2026-06-19 10:22 ` [PATCH 1/4] media: renesas: rcar-csi2: Add missing media_entity_cleanup() Biren Pandya
2026-06-19 10:22 ` [PATCH 2/4] media: renesas: csisp: " Biren Pandya
2026-06-19 10:22 ` Biren Pandya [this message]
2026-06-19 10:22 ` [PATCH 4/4] media: renesas: rzg2l-core: " Biren Pandya
2026-06-19 12:17 ` [PATCH v2 1/4] media: renesas: rcar-csi2: " Biren Pandya
2026-06-19 12:17   ` [PATCH v2 2/4] media: renesas: csisp: " Biren Pandya
2026-06-19 12:17   ` [PATCH v2 3/4] media: renesas: rcar-core: " Biren Pandya
2026-06-19 12:17   ` [PATCH v2 4/4] media: renesas: rzg2l-core: " Biren Pandya
2026-06-22  8:06   ` [PATCH v2 1/4] media: renesas: rcar-csi2: " Jacopo Mondi
2026-06-22 11:57     ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260619102241.22887-9-birenpandya@gmail.com \
    --to=birenpandya@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-media@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox