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: <20260211-wiz-v1-1-fdd018d02f33@gmail.com>
Date: Wed, 11 Feb 2026 02:14:11 +0800
From: Felix Gu <ustc.gu@...il.com>
To: Vinod Koul <vkoul@...nel.org>, 
 Neil Armstrong <neil.armstrong@...aro.org>, 
 Kishon Vijay Abraham I <kishon@...nel.org>, Jyri Sarha <jsarha@...com>
Cc: linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org, 
 Felix Gu <ustc.gu@...il.com>
Subject: [PATCH] phy: ti: j721e-wiz: Fix device_node leak in
 wiz_get_lane_phy_types()

The 'serdes' device_node is obtained using of_get_child_by_name(),
which increments the reference count. However, it is never put,
leading to a memory leak.

Use the __free(device_node) attribute to automatically decrement
the reference count when the 'serdes' variable goes out of scope.

Fixes: 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver")
Signed-off-by: Felix Gu <ustc.gu@...il.com>
---
 drivers/phy/ti/phy-j721e-wiz.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
index 12a19bf2875c..904541e9138e 100644
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -1407,9 +1407,8 @@ MODULE_DEVICE_TABLE(of, wiz_id_table);
 
 static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz)
 {
-	struct device_node *serdes;
-
-	serdes = of_get_child_by_name(dev->of_node, "serdes");
+	struct device_node *serdes __free(device_node) =
+		of_get_child_by_name(dev->of_node, "serdes");
 	if (!serdes) {
 		dev_err(dev, "%s: Getting \"serdes\"-node failed\n", __func__);
 		return -EINVAL;

---
base-commit: 193579fe01389bc21aff0051d13f24e8ea95b47d
change-id: 20260204-wiz-9a67604a034f

Best regards,
-- 
Felix Gu <ustc.gu@...il.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ