Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: ti: j721e-wiz: Fix device node reference 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 reference leak.

Add the missing of_node_put() calls to ensure the reference count is
properly balanced.

Fixes: 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver")
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20260212-wiz-v2-1-6e8bd4cc7a4a@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Felix Gu and committed by
Vinod Koul
584b457f f0cf0a88

+2
+2
drivers/phy/ti/phy-j721e-wiz.c
··· 1425 1425 dev_err(dev, 1426 1426 "%s: Reading \"reg\" from \"%s\" failed: %d\n", 1427 1427 __func__, subnode->name, ret); 1428 + of_node_put(serdes); 1428 1429 return ret; 1429 1430 } 1430 1431 of_property_read_u32(subnode, "cdns,num-lanes", &num_lanes); ··· 1440 1439 } 1441 1440 } 1442 1441 1442 + of_node_put(serdes); 1443 1443 return 0; 1444 1444 } 1445 1445