Linux kernel staging patches
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-staging@lists.linux.dev, linux-tegra@vger.kernel.org,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sowjanya Komatineni <skomatineni@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one()
Date: Thu, 29 Feb 2024 19:55:46 +0100	[thread overview]
Message-ID: <dbebaea7-289c-47d9-ba06-cd58a10ea662@web.de> (raw)

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


             reply	other threads:[~2024-02-29 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 18:55 Markus Elfring [this message]
2024-03-01 17:39 ` [PATCH] staging: media: tegra-video: Use common error handling code in tegra_vi_graph_parse_one() 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

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=dbebaea7-289c-47d9-ba06-cd58a10ea662@web.de \
    --to=markus.elfring@web.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).