Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: qcom: Release connector fwnode after regulator lookup
@ 2026-11-12  2:18 Xiangwu Lai
  2026-11-12  2:22 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Xiangwu Lai @ 2026-11-12  2:18 UTC (permalink / raw)
  To: bryan.odonoghue
  Cc: heikki.krogerus, linux-arm-msm, linux-usb, linux-kernel,
	Xiangwu Lai

pmic_typec_port_probe() looks up the "connector" child node with
device_get_named_child_node(), which takes a reference on the
returned fwnode.  The node is only used for the VBUS regulator lookup
from the connector node and the reference is never dropped, so every
probe leaks one fwnode reference.

Release the reference right after the regulator lookup, mirroring
the parent driver which already manages its own reference on the
same node.

Fixes: 506927b6bf29 ("usb: typec: tcpm: qcom: prefer VBUS supply from the connector node")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
index d3523435f..084e8e9a8 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
@@ -733,6 +733,8 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
 	pmic_typec_port->vdd_vbus = devm_of_regulator_get_optional(dev,
 								   to_of_node(connector),
 								   "vbus");
+	fwnode_handle_put(connector);
+
 	if (pmic_typec_port->vdd_vbus == ERR_PTR(-ENODEV))
 		pmic_typec_port->vdd_vbus = devm_regulator_get(dev, "vdd-vbus");
 	if (IS_ERR(pmic_typec_port->vdd_vbus))
-- 
2.50.1.windows.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-12  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12  2:18 [PATCH] usb: typec: tcpm: qcom: Release connector fwnode after regulator lookup Xiangwu Lai
2026-11-12  2:22 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox