From: Jia-Ju Bai Date: Mon, 4 Jan 2016 08:14:43 +0000 (+0800) Subject: ehci-hcd: Cleanup memory resources when ehci_halt fails X-Git-Tag: v4.6-rc1~117^2~144 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d8ff463a4ef22f090df21a3c5b34b336e80b72ca;p=linux.git ehci-hcd: Cleanup memory resources when ehci_halt fails The driver calls ehci_mem_init to allocate memory resources. But these resources are not freed when ehci_halt fails. This patch adds "ehci_mem_cleanup" in error handling code to fix this problem. Signed-off-by: Jia-Ju Bai Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 14178bbf0694..00e77cc91053 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -675,8 +675,10 @@ int ehci_setup(struct usb_hcd *hcd) return retval; retval = ehci_halt(ehci); - if (retval) + if (retval) { + ehci_mem_cleanup(ehci); return retval; + } ehci_reset(ehci);