From: Tuomas Tynkkynen Date: Tue, 17 Jun 2014 14:17:40 +0000 (+0300) Subject: USB: EHCI: tegra: Fix use-after-free in .remove() X-Git-Tag: firefly_0821_release~176^2~3489^2~47 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6a70b621227d1fd3efd150fce63ea4d51d4acaa9;p=firefly-linux-kernel-4.4.55.git USB: EHCI: tegra: Fix use-after-free in .remove() The tegra_ehci_hcd structure is located in the private space allocated by the core USB code so it must not be accessed after the HCD is freed. Signed-off-by: Tuomas Tynkkynen Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index c303371f67bc..693f792aa7f5 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -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; }