linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: xusb: Fix missing put_device() in tegra210_xusb_padctl_probe
@ 2021-12-30  8:00 Miaoqian Lin
  0 siblings, 0 replies; only message in thread
From: Miaoqian Lin @ 2021-12-30  8:00 UTC (permalink / raw)
  Cc: linmq006, JC Kuo, Kishon Vijay Abraham I, Vinod Koul,
	Thierry Reding, Jonathan Hunter, linux-phy, linux-tegra,
	linux-kernel

If of_find_device_by_node() succeeds, tegra210_xusb_padctl_probe()
doesn't have a corresponding put_device(). Thus add put_device() to
fix the exception handling.

Fixes: 2d10214 ("phy: tegra: xusb: Add wake/sleepwalk for Tegra210")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/tegra/xusb-tegra210.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c
index eedfc7c2cc05..05a0800af0e8 100644
--- a/drivers/phy/tegra/xusb-tegra210.c
+++ b/drivers/phy/tegra/xusb-tegra210.c
@@ -3170,8 +3170,10 @@ tegra210_xusb_padctl_probe(struct device *dev,
 		goto out;
 	}
 
-	if (!platform_get_drvdata(pdev))
+	if (!platform_get_drvdata(pdev)) {
+		put_device(&pdev->dev);
 		return ERR_PTR(-EPROBE_DEFER);
+	}
 
 	padctl->regmap = dev_get_regmap(&pdev->dev, "usb_sleepwalk");
 	if (!padctl->regmap)
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-30  8:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-30  8:00 [PATCH] phy: tegra: xusb: Fix missing put_device() in tegra210_xusb_padctl_probe Miaoqian Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).