From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/6] usb: typec: tcpm: qcom: prefer VBUS supply from the connector node
Date: Tue, 19 May 2026 11:16:26 +0000 [thread overview]
Message-ID: <20260519111626.A8A98C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260519-fix-tcpm-vbus-v1-2-14754695282d@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The fwnode_handle reference acquired via device_get_named_child_node() for the 'connector' node is never released, causing a memory and reference count leak.
--
commit 41b7b2878f5810dff29da5bdf47dafca44618828
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
usb: typec: tcpm: qcom: prefer VBUS supply from the connector node
This commit updates the VBUS supply retrieval to first try fetching it from
the "connector" child node before falling back to the "vdd-vbus" property on
the device node.
> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
[ ... ]
> @@ -720,7 +722,15 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
>
> mutex_init(&pmic_typec_port->vbus_lock);
>
> - pmic_typec_port->vdd_vbus = devm_regulator_get(dev, "vdd-vbus");
> + connector = device_get_named_child_node(dev, "connector");
device_get_named_child_node() returns a fwnode_handle with an incremented
reference count.
Does this code leak the connector node reference by never calling
fwnode_handle_put(connector) after getting the regulator or returning an
error?
> + if (!connector)
> + return -EINVAL;
> +
> + pmic_typec_port->vdd_vbus = devm_of_regulator_get_optional(dev,
> + to_of_node(connector),
> + "vbus");
> + 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))
> return PTR_ERR(pmic_typec_port->vdd_vbus);
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260519-fix-tcpm-vbus-v1-0-14754695282d@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-05-19 11:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 10:48 [PATCH 0/6] usb: typec: tcpm: qcom: use connector to specify VBUS regulator Dmitry Baryshkov
2026-05-19 10:48 ` [PATCH 1/6] dt-bindings: usb: qcom,pmic-typec: deprecate device-specific VBUS Dmitry Baryshkov
2026-05-19 10:58 ` sashiko-bot
2026-05-19 11:26 ` Konrad Dybcio
2026-05-19 11:37 ` Bryan O'Donoghue
2026-05-19 10:48 ` [PATCH 2/6] usb: typec: tcpm: qcom: prefer VBUS supply from the connector node Dmitry Baryshkov
2026-05-19 11:16 ` sashiko-bot [this message]
2026-05-19 11:25 ` Konrad Dybcio
2026-05-19 14:05 ` Heikki Krogerus
2026-05-19 10:48 ` [PATCH 3/6] arm64: dts: qcom: pm4125: move vdd-vbus-supply to connector nodes Dmitry Baryshkov
2026-05-19 11:26 ` Konrad Dybcio
2026-05-19 10:48 ` [PATCH 4/6] arm64: dts: qcom: pm7250b: " Dmitry Baryshkov
2026-05-19 11:27 ` Konrad Dybcio
2026-05-19 12:01 ` sashiko-bot
2026-05-19 12:17 ` Dmitry Baryshkov
2026-05-19 10:48 ` [PATCH 5/6] arm64: dts: qcom: pm8150b: " Dmitry Baryshkov
2026-05-19 11:27 ` Konrad Dybcio
2026-05-19 13:00 ` sashiko-bot
2026-05-19 10:48 ` [PATCH 6/6] arm64: dts: qcom: pmi632: " Dmitry Baryshkov
2026-05-19 11:27 ` Konrad Dybcio
2026-05-19 11:41 ` [PATCH 0/6] usb: typec: tcpm: qcom: use connector to specify VBUS regulator Bryan O'Donoghue
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=20260519111626.A8A98C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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