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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <e7caae09-70fd-431a-9df2-4c3068851a35@web.de>
Date: Thu, 19 Sep 2024 18:15:23 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>,
 Igal Liberman <igal.liberman@...escale.com>, Jakub Kicinski
 <kuba@...nel.org>, Madalin Bucur <madalin.bucur@....com>,
 Paolo Abeni <pabeni@...hat.com>, Sean Anderson <sean.anderson@...o.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] net: fman: Use of_node_put(muram_node) call only once in
 read_dts_node()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 19 Sep 2024 18:05:28 +0200

A of_node_put(muram_node) call was immediately used after a return code
check for a of_address_to_resource() call in this function implementation.
Thus use such a function call 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/net/ethernet/freescale/fman/fman.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index d96028f01770..8c29ac9dd850 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -2776,15 +2776,13 @@ static struct fman *read_dts_node(struct platform_device *of_dev)

 	err = of_address_to_resource(muram_node, 0,
 				     &fman->dts_params.muram_res);
+	of_node_put(muram_node);
 	if (err) {
-		of_node_put(muram_node);
 		dev_err(&of_dev->dev, "%s: of_address_to_resource() = %d\n",
 			__func__, err);
 		goto fman_free;
 	}

-	of_node_put(muram_node);
-
 	err = devm_request_irq(&of_dev->dev, irq, fman_irq, IRQF_SHARED,
 			       "fman", fman);
 	if (err < 0) {
--
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ