public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Markus Elfring <elfring@users.sourceforge.net>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sasha Levin <sashal@kernel.org>,
	patrice.chotard@foss.st.com, mchehab@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: [PATCH AUTOSEL 6.12 187/486] media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
Date: Mon,  5 May 2025 18:34:23 -0400	[thread overview]
Message-ID: <20250505223922.2682012-187-sashal@kernel.org> (raw)
In-Reply-To: <20250505223922.2682012-1-sashal@kernel.org>

From: Markus Elfring <elfring@users.sourceforge.net>

[ Upstream commit b773530a34df0687020520015057075f8b7b4ac4 ]

An of_node_put(i2c_bus) call was immediately used after a pointer check
for an of_find_i2c_adapter_by_node() call in this function implementation.
Thus call such a function only once instead directly before the check.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
index 67d3d6e50d2e2..ed3a107965cc9 100644
--- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
@@ -797,13 +797,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
 		}
 		tsin->i2c_adapter =
 			of_find_i2c_adapter_by_node(i2c_bus);
+		of_node_put(i2c_bus);
 		if (!tsin->i2c_adapter) {
 			dev_err(&pdev->dev, "No i2c adapter found\n");
-			of_node_put(i2c_bus);
 			ret = -ENODEV;
 			goto err_node_put;
 		}
-		of_node_put(i2c_bus);
 
 		/* Acquire reset GPIO and activate it */
 		tsin->rst_gpio = devm_fwnode_gpiod_get(dev,
-- 
2.39.5


       reply	other threads:[~2025-05-05 22:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250505223922.2682012-1-sashal@kernel.org>
2025-05-05 22:34 ` Sasha Levin [this message]
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 192/486] drm/gem: Test for imported GEM buffers with helper Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 203/486] media: cx231xx: set device_caps for 417 Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 211/486] media: imx335: Set vblank immediately Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 220/486] media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 221/486] media: uvcvideo: Handle uvc menu translation inside uvc_get_le_value Sasha Levin
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 261/486] media: adv7180: Disable test-pattern control on adv7180 Sasha Levin
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 262/486] media: tc358746: improve calculation of the D-PHY timing registers Sasha Levin
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 277/486] drm/amdgpu: remove all KFD fences from the BO on release Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 320/486] media: test-drivers: vivid: don't call schedule in loop Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 339/486] media: i2c: imx219: Correct the minimum vblanking value Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 340/486] media: v4l: Memset argument to 0 before calling get_mbus_config pad op Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 417/486] media: qcom: camss: csid: Only add TPG v4l2 ctrl if TPG hardware is available Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 418/486] media: qcom: camss: Add default case in vfe_src_pad_code Sasha Levin

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=20250505223922.2682012-187-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=elfring@users.sourceforge.net \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=stable@vger.kernel.org \
    /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