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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1470034963-30506-7-git-send-email-peter.chen@nxp.com>
Date:	Mon, 1 Aug 2016 15:02:34 +0800
From:	Peter Chen <peter.chen@....com>
To:	<davem@...emloft.net>
CC:	<netdev@...r.kernel.org>, <vbridger@...nsource.altera.com>,
	<isubramanian@....com>, <kchudgar@....com>,
	<yisen.zhuang@...wei.com>, <salil.mehta@...wei.com>,
	<thomas.petazzoni@...e-electrons.com>,
	<sergei.shtylyov@...entembedded.com>, <peppe.cavallaro@...com>,
	<alexandre.torgue@...com>, <mugunthanvnm@...com>,
	<tremyfr@...il.com>, <wxt@...k-chips.com>, <arnd@...db.de>,
	<david.daney@...ium.com>, <huangdaode@...ilicon.com>,
	<jszhang@...vell.com>, Peter Chen <peter.chen@....com>
Subject: [PATCH v2 06/15] ethernet: hisilicon: hns: hns_dsaf_mac: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Signed-off-by: Peter Chen <peter.chen@....com>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 3fb87e2..5c8afe1 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -795,6 +795,7 @@ static int  hns_mac_get_info(struct hns_mac_cb *mac_cb)
 			dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
 				mac_cb->mac_id, np->name);
 		}
+		of_node_put(np);
 
 		return 0;
 	}
@@ -812,10 +813,12 @@ static int  hns_mac_get_info(struct hns_mac_cb *mac_cb)
 			dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
 				mac_cb->mac_id, np->name);
 		}
+		of_node_put(np);
 
-		syscon = syscon_node_to_regmap(
-				of_parse_phandle(to_of_node(mac_cb->fw_port),
-						 "serdes-syscon", 0));
+		np = of_parse_phandle(to_of_node(mac_cb->fw_port),
+					"serdes-syscon", 0);
+		syscon = syscon_node_to_regmap(np);
+		of_node_put(np);
 		if (IS_ERR_OR_NULL(syscon)) {
 			dev_err(mac_cb->dev, "serdes-syscon is needed!\n");
 			return -EINVAL;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ