From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
Cc: bryan.odonoghue@linaro.org, linux-arm-msm@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tcpm: qcom: Release connector fwnode after regulator lookup
Date: Fri, 13 Nov 2026 13:05:27 +0100 [thread overview]
Message-ID: <avb9Bwr_VSkB56rP@black.igk.intel.com> (raw)
In-Reply-To: <20261112021836.1851-1-laixiangwu@cmss.chinamobile.com>
On Thu, Nov 12, 2026 at 10:18:36AM +0800, Xiangwu Lai wrote:
> 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>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.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
>
>
--
heikki
prev parent reply other threads:[~2026-11-13 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2026-11-13 12:05 ` Heikki Krogerus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avb9Bwr_VSkB56rP@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=bryan.odonoghue@linaro.org \
--cc=laixiangwu@cmss.chinamobile.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox