summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2016-01-04 16:14:43 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-24 20:51:34 -0800
commitd8ff463a4ef22f090df21a3c5b34b336e80b72ca (patch)
tree5d44025803ae1fdd22839090dfc56191e6a118cb /drivers/usb/host/ehci-hcd.c
parent4bb3cad7125ba03255025cf1e4e7c638e4757f6c (diff)
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 <baijiaju1990@163.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c4
1 files changed, 3 insertions, 1 deletions
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);