Skip to contentSkip to conversation

phy: tegra: xusb: Fix missing put_device() in tegra210_xusb_padctl_probe

PATCH New Miaoqian Lin 1 participant 1 message Dec 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: tegra: xusb: Fix missing put_device() in tegra210_xusb_padctl_probe

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")
---
 drivers/phy/tegra/xusb-tegra210.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/tegra/xusb-tegra210.c +3 -1
index eedfc7c2cc05..05a0800af0e8 100644
@@ -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)
Signature · 1 line
2.17.1