From: Guangshuo Li <lgs201920130244@gmail.com>
To: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Johan Hovold <johan@kernel.org>,
Guangshuo Li <lgs201920130244@gmail.com>,
Kishon Vijay Abraham I <kishon@kernel.org>,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] phy: ti: omap-usb2: fix OF node leak at probe
Date: Wed, 8 Jul 2026 16:12:54 +0800 [thread overview]
Message-ID: <20260708081254.734892-1-lgs201920130244@gmail.com> (raw)
omap_usb2_probe() parses the ctrl-module phandle and then looks up the
corresponding platform device.
of_parse_phandle() returns a device node with a reference that must be
dropped by the caller. The driver currently keeps the device reference
taken by of_find_device_by_node() until unbind, but never drops the
temporary OF node reference taken by of_parse_phandle().
Drop the OF node reference after of_find_device_by_node() has consumed
the node. This covers both the successful lookup path and the
Fixes: 9955a7835bf3 ("phy: omap-usb2: use *syscon* framework API to power on/off the PHY")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/phy/ti/phy-omap-usb2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index 1eb252604441..660df3181e4f 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -426,6 +426,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
}
control_pdev = of_find_device_by_node(control_node);
+ of_node_put(control_node);
if (!control_pdev) {
dev_err(&pdev->dev, "Failed to get control device\n");
return -EINVAL;
--
2.43.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next reply other threads:[~2026-07-08 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 8:12 Guangshuo Li [this message]
2026-07-08 8:23 ` [PATCH] phy: ti: omap-usb2: fix OF node leak at probe sashiko-bot
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=20260708081254.734892-1-lgs201920130244@gmail.com \
--to=lgs201920130244@gmail.com \
--cc=johan@kernel.org \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=vkoul@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