lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <e3b1fa29-71ff-4f40-a265-9ebdcc6d50f9@web.de>
Date: Thu, 3 Oct 2024 21:46:12 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-media@...r.kernel.org, Hans Verkuil <hans.verkuil@...co.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Tim Harvey <tharvey@...eworks.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Javier Carrasco <javier.carrasco.cruz@...il.com>
Subject: [PATCH] media: i2c: tda1997x: Call of_node_put(ep) only once in
 tda1997x_parse_dt()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 3 Oct 2024 21:38:45 +0200

An of_node_put(ep) call was immediately used after a return value check
for a v4l2_fwnode_endpoint_parse() 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@...rs.sourceforge.net>
---
 drivers/media/i2c/tda1997x.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 3b7e5ff5b010..959590afc80f 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2315,11 +2315,10 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
 		return -EINVAL;

 	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
-	if (ret) {
-		of_node_put(ep);
-		return ret;
-	}
 	of_node_put(ep);
+	if (ret)
+		return ret;
+
 	pdata->vidout_bus_type = bus_cfg.bus_type;

 	/* polarity of HS/VS/DE */
--
2.46.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ