USB: EHCI: tegra: Fix use-after-free in .remove()
[cascardo/linux.git] / drivers / usb / host / ehci-tegra.c
index c303371..693f792 100644 (file)
@@ -479,10 +479,11 @@ static int tegra_ehci_remove(struct platform_device *pdev)
 
        usb_phy_shutdown(hcd->phy);
        usb_remove_hcd(hcd);
-       usb_put_hcd(hcd);
 
        clk_disable_unprepare(tegra->clk);
 
+       usb_put_hcd(hcd);
+
        return 0;
 }