Commit 9ea90e9f authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman

usb: host: xhci-tegra: add missing put_device() in tegra_xusb_probe()

Goto put_padctl to put refcount of device on error in tegra_xusb_probe()

Fixes: 971ee247 ("usb: xhci: tegra: Enable ELPG for runtime/system PM")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210616044519.2183826-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d143825b
......@@ -1454,12 +1454,16 @@ static int tegra_xusb_probe(struct platform_device *pdev)
return PTR_ERR(tegra->padctl);
np = of_parse_phandle(pdev->dev.of_node, "nvidia,xusb-padctl", 0);
if (!np)
return -ENODEV;
if (!np) {
err = -ENODEV;
goto put_padctl;
}
tegra->padctl_irq = of_irq_get(np, 0);
if (tegra->padctl_irq <= 0)
return (tegra->padctl_irq == 0) ? -ENODEV : tegra->padctl_irq;
if (tegra->padctl_irq <= 0) {
err = (tegra->padctl_irq == 0) ? -ENODEV : tegra->padctl_irq;
goto put_padctl;
}
tegra->host_clk = devm_clk_get(&pdev->dev, "xusb_host");
if (IS_ERR(tegra->host_clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment