public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one()
@ 2024-02-29 18:55 Markus Elfring
  2024-03-01 17:39 ` Luca Ceresoli
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2024-02-29 18:55 UTC (permalink / raw)
  To: linux-staging, linux-tegra, linux-media, kernel-janitors,
	Greg Kroah-Hartman, Jonathan Hunter, Luca Ceresoli,
	Mauro Carvalho Chehab, Sowjanya Komatineni, Thierry Reding
  Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 29 Feb 2024 19:44:36 +0100

Add a jump target so that a bit of exception handling can be better reused
at the end of this function implementation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/media/tegra-video/vi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index af6e3a0d8df4..5a08d9551f8b 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1730,21 +1730,20 @@ static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
 			ret = PTR_ERR(tvge);
 			dev_err(vi->dev,
 				"failed to add subdev to notifier: %d\n", ret);
-			fwnode_handle_put(remote);
-			goto cleanup;
+			goto put_fwnode;
 		}

 		ret = tegra_vi_graph_parse_one(chan, remote);
-		if (ret < 0) {
-			fwnode_handle_put(remote);
-			goto cleanup;
-		}
+		if (ret < 0)
+			goto put_fwnode;

 		fwnode_handle_put(remote);
 	}

 	return 0;

+put_fwnode:
+	fwnode_handle_put(remote);
 cleanup:
 	dev_err(vi->dev, "failed parsing the graph: %d\n", ret);
 	v4l2_async_nf_cleanup(&chan->notifier);
--
2.44.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-05 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 18:55 [PATCH] staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one() Markus Elfring
2024-03-01 17:39 ` Luca Ceresoli
2024-03-02  9:30   ` Dan Carpenter
2024-03-02 10:40     ` Markus Elfring
2024-03-05 15:24       ` Luca Ceresoli
2024-03-05 16:21         ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox